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