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