human
Write me a code to find the element that appears once in an array where every other element appears twice and the other steps required given the following:
Find the element that appears once in an array where every other element appears twice | function which find number.
applying the formula ..
driver code"
Solution in Python:
assistant
#Here is code to find the element that appears once in an array where every other element appears twice and the other steps required.
 def singleNumber ( nums ) :
	return 2 * sum ( set ( nums ) ) - sum ( nums )
a = [ 2 , 3 , 5 , 4 , 5 , 3 , 4 ]
print ( int ( singleNumber ( a ) ) )
a = [ 15 , 18 , 16 , 18 , 16 , 15 , 89 ]
print ( int ( singleNumber ( a ) ) )