- 博客(1)
- 收藏
- 关注
原创 leetcode 给定一个大小为 n 的数组,找到其中的众数(python)
leetcode 给定一个大小为 n 的数组,找到其中的众数(python) 小白探索之路,记录自己的代码,并希望对你有所帮助 语言:python class Solution: def majorityElement(self, nums: List[int]) -> int: se=set(nums) a=0 c=0 for i in se: b=nums.count(i) if a&...
2019-05-13 16:29:36
712
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人