Page Contents
0SUMRANGE SOLUTIONS SC_01 CODECHEF
Problem Statement
We have a number arrangement A, whose length is N.
Locate the quantity of the non-void touching aftereffects of A whose total is 0. Note that we are excluding the approaches to take aftereffects. That is, regardless of whether the substance of somewhere in the range of two aftereffects are the equivalent, they are checked separately on the off chance that they are taken from various positions.
Info
Info is given in the accompanying organization:
N
A1 A2 . . . AN
Yield
Locate the quantity of the non-void adjacent aftereffects of A whose whole is 0.
Requirements
1≤N≤2×105
−109≤Ai≤109
All qualities in input are whole numbers.
Test Input
7
1 3 – 4 2 – 2
Test Output
3
Clarification
There are three adjacent aftereffects whose wholes are 0: (1,3,−4), (−4,2,2) and (2,−2)