Given an unsorted array of integers, the task is to find the number of subarrays with a sum equal to a given number k. Two approaches are discussed: a Naive approach using nested loops with O(n^2) time complexity and an efficient approach using Hash Map and Prefix Sum with O(n) time complexity. The second approach stores the frequency of prefix sums and checks if the difference of current sum and k exists in the map. The result is incremented accordingly.
For more details, check the full article here.