mirror of
https://gitlab.com/mfocko/CodeWars.git
synced 2024-11-08 18:49:07 +01:00
16 lines
274 B
Python
16 lines
274 B
Python
def find_uniq(arr):
|
|
a = arr[0]
|
|
count_a = 1
|
|
b = None
|
|
count_b = 0
|
|
|
|
for e in arr[1:]:
|
|
if e != a:
|
|
count_b += 1
|
|
b = e
|
|
else:
|
|
count_a += 1
|
|
if count_a < count_b:
|
|
return a
|
|
else:
|
|
return b
|