Question #238157

odd one out given some space-separated list of integers, every element appears twice other than one element . write a program to find the element which appeared only once. answer

Expert's answer

def get_single(arr):
	return 2 * sum(set(arr)) - sum(arr)

a = [3,5,6,7,1,3,5,6,7]
print (int(get_single(a)))

LATEST TUTORIALS
APPROVED BY CLIENTS