def remove_dirty_chars(string, second_string):
	NO_OF_CHARS = 256
	def str_to_list(string): 
		temp = [] 
		for x in string: 
			temp.append(x) 
		return temp 
	def lst_to_string(List): 
		return ''.join(List) 
	def get_char_count_array(string): 
		count = [0] * NO_OF_CHARS 
		for i in string: 
			count[ord(i)] += 1
		return count 
	 
	count = get_char_count_array(second_string) 
	ip_ind = 0
	res_ind = 0
	temp = '' 
	str_list = str_to_list(string) 
	while ip_ind != len(str_list): 
		temp = str_list[ip_ind] 
		if count[ord(temp)] == 0: 
			str_list[res_ind] = str_list[ip_ind] 
			res_ind += 1
		ip_ind+=1
	return lst_to_string(str_list[0:res_ind]) 
def remove_dirty_chars(string2, second_string):
    NO_OF_CHARS = 256
    def str_to_list(string2):
        temp = []
        for x in string2:
            temp.append(x)
        return temp
    def lst_to_string(List):
        return "".join(List)
    def get_char_count_array(string2):
        count = [0] * NO_OF_CHARS
        for i in string2:
            count[ord(i)] += 1
        return count
       
    count = get_char_count_array(second_string)
    ip_ind = 0
    res_ind = 0
    temp = ""
    str_list = str_to_list(string2)
    while ip_ind != len(str_list):
        temp = str_list[ip_ind]
        if count[ord(temp)] == 0:
            str_list[res_ind] = str_list[ip_ind]
            res_ind += 1
        ip_ind += 1
    return lst_to_string(str_list[0:res_ind])