Spot the Unique Number
In this list, almost every number is the same, but one value stands out from the rest. Write find_uniq, which receives a list arr with at least three numbers and returns the only unique value. The numbers may be floats, so compare the actual values, not their positions.
Примеры
Ввод
[1, 1, 1, 2, 1, 1]Вывод
2Ввод
[0, 0, 0.55, 0, 0]Вывод
0.55Ввод
[3, 3, 3, 3, 9, 3]Вывод
9Нужно реализовать
def find_uniq(arr: list[float]) -> float:
Теги
arraymath
Accedi per vedere la cronologia degli invii
AccediAccedi per usare l'AI Mentor
AccediVisible tests
1
Input
[1,1,1,2,1,1]Expected
22
Input
[0,0,0.55,0,0]Expected
0.553
Input
[3,3,3,3,9,3]Expected
94
Input
[5,1,1,1]Expected
55
Input
[2,2,2,7]Expected
76
Input
[0,0,0,0,0,0]Expected
0Focus radio
Paused · SomaFM · Fluid