Problem 1918 · Medium
Binary search the answer value; a sliding window counts the subarrays whose sum stays at most the candidate.
Open the interactive visualisation