Course · Section 9: Data Structures, Modern Operators and Strings · Lecture 124: Maps: Fundamentals
Implement `subarraySumCount(nums, k)` returning the number of contiguous subarrays summing to `k`, using prefix sums and a hash map.
+ 1 hidden test run on Submit.
Counting prefix sums in a map turns the O(n^2) scan into a single O(n) pass.
Run your code to see results.