Function to move all the alphabets to front
def removeChars ( hexaVal , S ) : NEW_LINE INDENT setk = set ( ) NEW_LINE for i in S : NEW_LINE INDENT setk . add ( i ) NEW_LINE DEDENT ans = ' ' NEW_LINE for i in hexaVal : NEW_LINE INDENT if i in setk : NEW_LINE INDENT continue NEW_LINE DEDENT ans += i NEW_LINE DEDENT return ans NEW_LINE DEDENT