Skip to main content

136. Single Number

https://leetcode.com/problems/single-number/

Python

Python Counter

from collections import Counter


class Solution:
def singleNumber(self, nums: List[int]) -> int:
counts = Counter(nums)

for num, count in counts.items():
if count == 1:
return num