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
Sorting then binary search
B
A heap
C
A sliding window that expands right and shrinks left while the sum stays ≥ S
D
All pairs O(n^2) is required