Practice
Learn
← Quit
0 / 0 correct
Algorithms
Medium
1 of 411
Which technique finds the smallest subarray with sum ≥ S in an array of positive numbers in O(n)?
A
Sorting then binary search
B
All pairs O(n^2) is required
C
A heap
D
A sliding window that expands right and shrinks left while the sum stays ≥ S