Stores the frequency of the characters of the string
freq = { } NEW_LINE for ch in range ( ' a ' , ' z ' ) : NEW_LINE INDENT freq [ chr ( ch ) ] = 0 NEW_LINE DEDENT for i in range ( n ) : NEW_LINE INDENT if str [ i ] in freq : NEW_LINE INDENT freq [ str [ i ] ] += 1 NEW_LINE DEDENT DEDENT