Answer to Question #238157 in Python for Sri

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
1
Expert's answer
2021-09-16T15:36:50-0400
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)))

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS