Complete the code to initialize the count of subarrays to zero.
int count = [1];We start counting subarrays from zero, so initializing count to 0 is correct.
Complete the code to update the cumulative sum with the current element.
cumulativeSum [1]= nums[i];We add the current element to the cumulative sum to keep track of the sum so far.
Fix the error in checking if (cumulativeSum - k) exists in the map.
if (prefixSumCount.find(cumulativeSum [1] k) != prefixSumCount.end()) {
We check if cumulativeSum - k exists to find subarrays summing to k.
Fill both blanks to update the map with the current cumulative sum count.
prefixSumCount[cumulativeSum] = prefixSumCount[1]cumulativeSum[2] 1;
We use square brackets to access the map element and add 1 to update the count.
Fill all three blanks to complete the loop that iterates over the array.
for (int [1] = 0; [2] < nums.size(); [3]++) {
The loop variable is i, starting at 0, running while less than nums.size(), and incrementing by 1 each time.
