Prefix Sum Clarification

Hi. Could someone please clarify why on line 28 of the java solution code, the answer variable is incremented by sums.get(prefixSum - target) instead of answer++? Thank you so much!
https://usaco.guide/problems/cses-1661-subarray-sums-ii/solution

There might be multiple valid array starts.

1 Like