Count frequency of characters
for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) >= 65 && s . charAt ( i ) <= 90 ) caps [ s . charAt ( i ) - ' A ' ] ++ ; else small [ s . charAt ( i ) - ' a ' ] ++ ; }