human
Find one extra character in a string | Python3 program to find extra character in one string.
store string values in map.
store second string in map with frequency.
store first string in map with frequency.
if the frequency is 1 then this character is which is added extra.
Driver Code.
given string.
find Extra Character"
Solution in Python:
 ... Give me a code to find one extra character in a string and the other steps required?
assistant
#Here is code to find one extra character in a string and the other steps required.
 def findExtraCharacter ( strA , strB ) :
	m1 = { }
	for i in strB :
		if i in m1 :
			m1 [ i ] += 1
		else :
			m1 [ i ] = 1
	for i in strA :
		m1 [ i ] -= 1
	for h1 in m1 :
		if m1 [ h1 ] == 1 :
			return h1
if __name__ == " _ _ main _ _ " :
	strA = ' abcd '
	strB = ' cbdad '
	print ( findExtraCharacter ( strA , strB ) )