LeetCode *** 275. H-Index II
2016-04-16 15:35
369 查看
题目:
Follow up for
H-Index: What if the
分析:
没啥想说的。
代码:
Follow up for
H-Index: What if the
citationsarray is sorted in ascending order? Could you optimize your algorithm?
分析:
没啥想说的。
代码:
class Solution { public: int hIndex(vector<int>& citations) { int h=0; for(int i=citations.size()-1;i>=0;--i){ if(h>=citations[i])return h; h++; } return h; } };
相关文章推荐
- DirectX 游戏开发
- 环形缓冲区
- 使用Spring 3的@value简化配置文件的读取
- squid 代理服务
- 多列索引结构和原理
- Jersey(1.19.1) - Representations and Java Types
- 将整数n分成k份,且每份不能为空,任意两种分法不能相同(不考虑顺序)【划分问题】
- PHP表单验证 -w3school PHP学习笔记
- HDU 2602 动态规划01背包
- androoid中SurfaceView加载照相机功能页面
- Python列表(List)
- iframe 动态onload事件处理方式
- Android 使用Handler的PostDelayed方法实现图片的轮播
- [算法导论笔记]建立二叉堆
- 定位服务不可用问题
- 《JS权威指南》学习笔记(一):类、值和变量
- siegen程的android技能树之回调函数(callback)
- zookeeper C API 编译
- hdu 5495 LCS
- 面试题目——String