Practice
Learn
← Quit
0 / 0 correct
Algorithms
Hard
1 of 561
How do prefix sums count subarrays with sum exactly k in O(n)?
A
Sort the array first
B
Use a sliding window only
C
Track counts of prefix sums in a hash map; for each prefix p, add count[p − k]
D
Two nested loops