Subarrays Summing to K — Solution & Editorial
Prefix-sum + hash map: while sweeping, add how many earlier prefixes equal (current prefix − K).
Complexity: O(N)
Prefix-sum + hash map: while sweeping, add how many earlier prefixes equal (current prefix − K).
Complexity: O(N)