H-Index II
来源:互联网 发布:淘宝优惠券网站源码 编辑:程序博客网 时间:2024/05/03 06:54
public class Solution { public int hIndex(int[] citations) { int n = citations.length; if (n == 0) { return 0; } int min = 0, max = n - 1; while (min <= max) { int mid = min + (max - min)/2; if (citations[mid] >= n - mid) { max = mid - 1; } else { min = mid + 1; } } return n - min; }}
0 0
- H-Index && H-Index II
- Leetcode: H-Index II
- Leetcode: H-Index II
- H index II
- [LeetCode]H-Index II
- H-Index II -- leetcode
- LeetCode H-Index II
- leetcode H-Index II
- [275]H-Index II
- [Leetcode]H-Index II
- [LeetCode] H-Index II
- H-Index II
- LeetCode -- H-Index II
- 275、H-Index II
- Leetcode188: H-Index II
- H-Index II
- H-Index II
- 275. H-Index II
- Codeforces 710A- King Moves
- 写JavaScript代码地方有3个
- cocoapods的安装 遇到 Error installing pods:activesupport requires Ruby version >=2.2.2
- MySql(12)------mysql视图实例大全
- Maximal Square
- H-Index II
- Course Schedule II
- 计蒜客 最大子矩阵
- Populating Next Right Pointers in Each Node II
- HTML5启动手机中的APP(IOS)
- 深度了解scrollview嵌套listview会出现的bug及解决方案
- 二进制数据与原码、反码、补码
- Post 和 get 的区别
- Codeforces 710B-Optimal Point on a Line