Stable Subarrays With Equal Boundary and Interior Sum
Use prefix sums and a hash map so each right end finds the left ends whose endpoint and interior sum both match.
Use prefix sums and a hash map so each right end finds the left ends whose endpoint and interior sum both match.