H-Index II
来源:互联网 发布:php面向对象的封装 编辑:程序博客网 时间:2024/06/07 13:25
c++
class Solution {public: int hIndex(vector<int>& citations) { if (citations.empty()) return 0; //sort(citations.begin(), citations.end()); int n = citations.size(); int st = 0; int ed = n - 1; int res = 0; while (st <= ed) { int mid = (st + ed) / 2; if (citations[mid] >= n - mid) { res = n - mid; ed = mid - 1; } else { st = mid + 1; } } return res; }};
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
- 文件缓存图片
- robotiums_apk重签名
- shell知识点整理
- BitmapDemo
- Java 数据结构之有序数组,二分查找法
- H-Index II
- LUA———Lua和C 区别
- 多线程下载断点续传
- DHTML技术:表单验证<form>
- 图的基本算法
- 【干货】Android应用架构笔记
- 初学ML笔记N0.1——线性回归,分类与逻辑斯蒂回归,通用线性模型
- SIP Call Flow - Registration
- Docker 从零开始制作基础镜像[centos]