Search
⌘K

Leetcode 1918. Kth Smallest Subarray Sum

Given an array of positive integers, find the k-th smallest sum among all contiguous subarray sums. Because elements are positive, you can binary-search the target sum and use a sliding-window / two-pointer or prefix-sum counting method to decide how many subarrays have sum ≤ mid.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Your account is free and you can post anonymously if you choose.