会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
ChevisZhang
博客园
首页
新随笔
联系
订阅
管理
2020年3月21日
347.前k个高频元素-counter(leetcode)
摘要: 给定一个非空的整数数组,返回其中出现频率前 k 高的元素。 法1) 使用 Counter 的most_common(k) 方法 from collections import Counter class Solution: def topKFrequent(self, nums: List[int]
阅读全文
posted @ 2020-03-21 18:03 ChevisZhang
阅读(157)
评论(0)
推荐(0)
公告