Append the remaining characters to the end of the result
while ( freq [ ord ( first ) ] > 0 ) : NEW_LINE INDENT answer . append ( first ) NEW_LINE freq [ ord ( first ) ] -= 1 NEW_LINE DEDENT answer += A NEW_LINE for j in range ( ord ( ' a ' ) , ord ( ' z ' ) + 1 ) : NEW_LINE