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