```
def singleNumber(self, A):
return sum(set(A))*2-sum(A)
```

# Single line solution using set

Every element is repeated twice except one so if we take set of A it has all unique numbers only. Therefore twice the sum of set(A) - sum of A will give that number which is not repeated.