class Solution(object):

def singleNonDuplicate(self, nums):

```
def f(n):
if len(n) == 1:
return n[-1]
if n[-1] != n[-2]:
return n[-1]
if len(n) > 1:
del n[-1]
del n[-1]
return f(n)
return f(nums)
```