Increase the frequency of the last character of the current substring
if ( map . get ( str . charAt ( i ) ) == null ) { map . put ( str . charAt ( i ) , 1 ) ; } else { map . put ( str . charAt ( i ) , map . get ( str . charAt ( i ) ) + 1 ) ; }