leetcode 274. H-Index
来源:互联网 发布:oracle误删除数据恢复 编辑:程序博客网 时间:2024/05/16 00:53
class Solution(object): def hIndex(self, citations): """ :type citations: List[int] :rtype: int """ m = len(citations) buckets = [0 for i in range(m+1)] for citation in citations: if citation >= m: buckets[m] += 1 else: buckets[citation] += 1 sum = 0 for i in range(m,-1,-1): sum += buckets[i] if sum >= i: return i return 0
阅读全文
0 0
- [leetcode] 274.H-Index
- Leetcode 274. H-Index
- leetcode 274. H-Index
- LeetCode *** 274. H-Index
- leetcode.274. H-Index
- 【leetcode】274. H-Index
- LeetCode - 274. H-Index
- LeetCode:274. H-Index
- [leetcode] 274. H-Index
- LeetCode 274.H-Index
- LeetCode 274. H-Index
- [LeetCode]274. H-Index
- 【LeetCode】 274. H-Index
- leetcode 274. H-Index
- Leetcode 274. H-Index
- LeetCode 274. H-Index
- [leetcode]274. H-Index
- leetcode 274. H-Index
- 将Ubuntu 16.14的用户界面语言从英语切换到汉语
- linux 下使用 ftp 下载 rpm 文件并安装时提示 rpmReadSignature 错误
- 大葱 剧毒 这批大葱检出剧毒农药!原计划运往全国,100多只羊吃葱叶死亡
- 程序逻辑问题--实验吧
- 1Java类加载机制和反射零散知识点
- leetcode 274. H-Index
- ALLEGRO学习之过孔要检查SOLDERMASK防止开窗
- 本地plsql直接配置到线上数据库
- 美光Crucial BX300 SSD评测 | 揭穿不实报道,惊不惊喜?
- react-native 中NativeBase框架500错误
- Git拉取分支代码小结以及问题解决
- 解决mysql插入中文乱码的问题
- 火狐FireFox兼容mouseover,mouseout的解决方案
- numpy: 新建二维序列数组