To store counts of different characters
for ( var i = 0 ; i < MAX_CHAR ; i ++ ) count [ i ] = 0 ; for ( var i = 0 ; i < n ; i ++ ) { if ( count [ str . charAt ( i ) . charCodeAt ( 0 ) - ' ' . charCodeAt ( 0 ) ] == 0 ) dist_count ++ ; count [ str . charAt ( i ) . charCodeAt ( 0 ) - ' ' . charCodeAt ( 0 ) ] ++ ; }