题解 | #数组中重复的数字#
数组中重复的数字
https://www.nowcoder.com/practice/6fe361ede7e54db1b84adc81d09d8524
class Solution: def duplicate(self , numbers: List[int]) -> int: # write code here for i in numbers: if numbers.count(i) >= 2: return i return -1
官方写的太复杂了,一个count不就完事了么