tags:
- code
topic: List
difficulty: Intermediate
link: https://www.codewars.com/kata/585d7d5adb20cf33cb000235
date: 2023-12-31
Problem
There is an array with some numbers. All numbers are equal except for one. Try to find it!
findUniq([ 1, 1, 1, 2, 1, 1 ]) === 2
findUniq([ 0, 0, 0.55, 0, 0 ]) === 0.55
def find_uniq(arr):
return next(i for i in set(arr) if arr.count(i) == 1)