Finding frequency of each character
for i in range ( 0 , len ( S ) ) : NEW_LINE INDENT if ( freq [ ord ( S [ i ] ) - 97 ] == 0 ) : NEW_LINE INDENT count += 1 NEW_LINE DEDENT freq [ ord ( S [ i ] ) - 97 ] += 1 NEW_LINE DEDENT