面试题03. 数组中重复的数字
# 法一
# 使用Counter统计,找到重复即可
from collections import Counter class Solution: def findRepeatNumber(self, nums: List[int]) -> int: c = Counter(nums) return c.most_common()[0][0]
2023-10-17 14:42:10
# 法一
# 使用Counter统计,找到重复即可
from collections import Counter class Solution: def findRepeatNumber(self, nums: List[int]) -> int: c = Counter(nums) return c.most_common()[0][0]