274. H-Index
来源:互联网 发布:win10系统自带优化 编辑:程序博客网 时间:2024/06/05 09:22
Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher’s h-index.
According to the definition of h-index on Wikipedia: “A scientist has index h if h of his/her N papers have at least h citations each, and the other N − h papers have no more than h citations each.”
For example, given citations = [3, 0, 6, 1, 5], which means the researcher has 5 papers in total and each of them had received 3, 0, 6, 1, 5 citations respectively. Since the researcher has 3 papers with at least 3 citations each and the remaining two with no more than 3 citations each, his h-index is 3.
Note: If there are several possible values for h, the maximum one is taken as the h-index.
class Solution { public int hIndex(int[] citations) { Arrays.sort(citations); int h = 0; for(int i = 0; i < citations.length; i++){ int currH = Math.min(citations[i], citations.length - i); if(currH > h){ h = currH; } } return h; }}
- 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
- springmvc 异常001---在SpringMVC中使用@RequestBody注解处理json时,报出HTTP Status 415的解决方案
- MFC中使用任务栏显示图标表示程序最小化
- 简单的前端渲染模板实现
- 如何看懂照片的直方图
- ios下button input checkbox radio 默认样式去除
- 274. H-Index
- 通过ViewDragHelper实现下拉Drawer
- JNI 学习笔记(三)-- JNI访问数组、引用、异常处理、缓存策略
- 数组的最大最小topk值
- 3. Longest Substring Without Repeating Characters
- 海思HI35XX之----音频模块使用总结
- 数据结构实验之栈与队列五:下一较大值(一)
- 音频编解码中关于转码以及播放的总结
- C++~无头单链表基本操作(全面版)