274. H-Index
来源:互联网 发布:gas mask mac 下载 编辑:程序博客网 时间:2024/06/16 04:47
class Solution(object):
def hIndex(self, citations):
"""
:type citations: List[int]
:rtype: int
"""
citations.sort()
n = len(citations)
for i in xrange(n):
if citations[i] >= (n-i):
return n-i
def hIndex(self, citations):
"""
:type citations: List[int]
:rtype: int
"""
citations.sort()
n = len(citations)
for i in xrange(n):
if citations[i] >= (n-i):
return n-i
return 0
https://discuss.leetcode.com/topic/23810/python-o-n-lgn-time-with-sort-o-n-time-with-o-n-space
阅读全文
0 0
- 274. H-Index & 275. H-Index II
- [leetcode] 274.H-Index
- Leetcode 274. H-Index
- leetcode 274. H-Index
- 274. H-Index
- 274. H-Index
- LeetCode *** 274. H-Index
- 274. H-Index
- 274. H-Index
- 274. H-Index
- 274. H-Index
- leetcode.274. H-Index
- 【leetcode】274. H-Index
- 274. H-Index
- 274. H-Index
- 274. H-Index
- LeetCode - 274. H-Index
- 274. H-Index
- 1_字符设备驱动程序之LED驱动程序
- 蓝牙模块DIY A09 HC-05主从机一体蓝牙模块 无线蓝牙 串口透传
- 基于ConcurrentHashMap实现ConcurrentHashSet
- 库函数和系统调用之间的联系和区别
- Java常用排序算法冒泡排序与选择排序总结
- 274. H-Index
- C语言的内存管理
- 嵌入式系统学习路线
- C语言中内存分配
- TensorFlow基础(一)
- MD5加密算法原理
- excel相关函数
- 解决VBS文件双击不能运行的问题
- JQuery动画效果