Increasing the current prefixSum index value in map by 1 to count the other perfect squares while traversing further
if ( mp . has ( prefixSum [ i ] ) ) { mp . set ( prefixSum [ i ] , mp . get ( prefixSum [ i ] ) + 1 ) ; } else { mp . set ( prefixSum [ i ] , 1 ) ; } } return countSubs ; }