Subarray Sum Equals K
Subarray Sum Equals K is a classic prefix sum problem that tests whether you can transform a subarray sum question into a hashmap lookup. The pattern appears in dozens of variations — counting subarrays with a given XOR, finding subarrays with equal 0s and 1s, and more.
Enable JavaScript for the full StreamPrep guide.