Problem 1918 · Medium

Kth Smallest Subarray Sum

Binary search the answer value; a sliding window counts the subarrays whose sum stays at most the candidate.

Open the interactive visualisation