[LeetCode] 287. Find the Duplicate Number
Python
class Solution:
def findDuplicate(self, nums: List[int]) -> int:
temp = Counter(nums)
for i, v in temp.items():
if v != 1:
return i
class Solution:
def findDuplicate(self, nums: List[int]) -> int:
temp = Counter(nums)
for i, v in temp.items():
if v != 1:
return i
댓글남기기