Nav: << previous: 273.整数转换英文表示 | next: 275.H 指数 II >>
Description
tab: English
<p>Given an array of integers <code>citations</code> where <code>citations[i]</code> is the number of citations a researcher received for their <code>i<sup>th</sup></code> paper, return <em>the researcher's h-index</em>.</p>
<p>According to the <a href="https://en.wikipedia.org/wiki/H-index" target="_blank">definition of h-index on Wikipedia</a>: The h-index is defined as the maximum value of <code>h</code> such that the given researcher has published at least <code>h</code> papers that have each been cited at least <code>h</code> times.</p>
<p> </p>
<p><strong class="example">Example 1:</strong></p>
<pre>
<strong>Input:</strong> citations = [3,0,6,1,5]
<strong>Output:</strong> 3
<strong>Explanation:</strong> [3,0,6,1,5] 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, their h-index is 3.
</pre>
<p><strong class="example">Example 2:</strong></p>
<pre>
<strong>Input:</strong> citations = [1,3,1]
<strong>Output:</strong> 1
</pre>
<p> </p>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>n == citations.length</code></li>
<li><code>1 <= n <= 5000</code></li>
<li><code>0 <= citations[i] <= 1000</code></li>
</ul>
> [!tip]- Hint 1
>
> An easy approach is to sort the array first.
> [!tip]- Hint 2
>
> What are the possible values of h-index?
> [!tip]- Hint 3
>
> A faster approach is to use extra space.
---
[submissions](https://leetcode.com/problems/h-index/submissions/) | [solutions](https://leetcode.com/problems/h-index/solutions/)
tab: 中文
<p>给你一个整数数组 <code>citations</code> ,其中 <code>citations[i]</code> 表示研究者的第 <code>i</code> 篇论文被引用的次数。计算并返回该研究者的 <strong><code>h</code><em> </em>指数</strong>。</p>
<p>根据维基百科上 <a href="https://baike.baidu.com/item/h-index/3991452?fr=aladdin" target="_blank">h 指数的定义</a>:<code>h</code> 代表“高引用次数” ,一名科研人员的 <code>h</code><strong> 指数 </strong>是指他(她)至少发表了 <code>h</code> 篇论文,并且 <strong>至少 </strong>有 <code>h</code> 篇论文被引用次数大于等于 <code>h</code> 。如果 <code>h</code><em> </em>有多种可能的值,<strong><code>h</code> 指数 </strong>是其中最大的那个。</p>
<p> </p>
<p><strong>示例 1:</strong></p>
<pre>
<strong>输入:</strong><code>citations = [3,0,6,1,5]</code>
<strong>输出:</strong>3
<strong>解释:</strong>给定数组表示研究者总共有 <code>5</code> 篇论文,每篇论文相应的被引用了 <code>3, 0, 6, 1, 5</code> 次。
由于研究者有 <code>3 </code>篇论文每篇 <strong>至少 </strong>被引用了 <code>3</code> 次,其余两篇论文每篇被引用 <strong>不多于</strong> <code>3</code> 次,所以她的 <em>h </em>指数是 <code>3</code>。</pre>
<p><strong>示例 2:</strong></p>
<pre>
<strong>输入:</strong>citations = [1,3,1]
<strong>输出:</strong>1
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>n == citations.length</code></li>
<li><code>1 <= n <= 5000</code></li>
<li><code>0 <= citations[i] <= 1000</code></li>
</ul>
> [!tip]- 提示 1
>
> An easy approach is to sort the array first.
> [!tip]- 提示 2
>
> What are the possible values of h-index?
> [!tip]- 提示 3
>
> A faster approach is to use extra space.
---
[提交记录](https://leetcode.cn/problems/h-index/submissions/) | [题解](https://leetcode.cn/problems/h-index/solution/)
Solutions & Notes
properties:
note.updated:
displayName: Last Updated
note.relative_links:
displayName: Related Links
note.desc:
displayName: Description
note.grade:
displayName: Rating
note.program_language:
displayName: Language
note.time_complexity:
displayName: TC
note.space_complexity:
displayName: SC
views:
- type: table
name: Solutions & Notes
filters:
and:
- file.hasLink(this.file)
- file.tags.containsAny("leetcode/solution", "leetcode/note")
order:
- file.name
- desc
- program_language
- time_complexity
- space_complexity
- grade
- relative_links
- updated
sort:
- property: grade
direction: ASC
- property: time_complexity
direction: ASC
- property: program_language
direction: ASC
columnSize:
file.name: 104
note.space_complexity: 65
note.grade: 126
Similar Problems
properties:
note.lcTopics:
displayName: Topics
note.lcAcRate:
displayName: AC Rate
note.favorites:
displayName: Favorites
note.grade:
displayName: Rating
note.translatedTitle:
displayName: Title (CN)
note.lcDifficulty:
displayName: Difficulty
views:
- type: table
name: Similar Problems
filters:
and:
- file.hasLink(this.file)
- similarQuestions.contains(this.file)
order:
- file.name
- translatedTitle
- lcTopics
- lcDifficulty
- lcAcRate
- grade
- favorites
sort:
- property: file.name
direction: ASC
- property: lcTopics
direction: DESC
columnSize:
note.translatedTitle: 240
note.lcTopics: 347
note.lcAcRate: 75
note.grade: 122