when size of string is greater than k to store the frequencies of the characters
freq = dict . fromkeys ( s , 0 ) NEW_LINE for i in range ( len ( s ) ) : NEW_LINE INDENT freq [ s [ i ] ] += 1 NEW_LINE DEDENT