Increase frequency of i - th character
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 ) ; } }