Insert characters in the string in increasing order
for i in range ( MAX ) : NEW_LINE INDENT j = 0 NEW_LINE while ( j < count [ i ] ) : NEW_LINE INDENT s = s . replace ( s [ index ] , chr ( 97 + i ) ) NEW_LINE index += 1 NEW_LINE j += 1 NEW_LINE DEDENT DEDENT