Otherwise , get the value from the map and update left [ i ]
else { pairr * tmp = mapp [ arr [ i ] ] ; left [ i ] = ( tmp -> count ) * ( i - tmp -> prevIndex ) + left [ tmp -> prevIndex ] ; mapp [ arr [ i ] ] = new pairr ( tmp -> count + 1 , i ) ; } }