Stores the frequency of prefix sums in the array
unordered_map < int , int > mp ; mp [ arr [ 0 ] ] = 0 ; for ( int i = 1 ; i < n ; i ++ ) { arr [ i ] = arr [ i ] + arr [ i - 1 ] ; mp [ arr [ i ] ] = i ; }