1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 19:18:14 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/H 指数 II [h-index-ii].html
2022-03-29 12:43:11 +08:00

36 lines
2.0 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>给你一个整数数组 <code>citations</code> ,其中 <code>citations[i]</code> 表示研究者的第 <code>i</code> 篇论文被引用的次数,<code>citations</code> 已经按照 <strong>升序排列 </strong>。计算并返回该研究者的 <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>h 代表“高引用次数”high citations一名科研人员的 h 指数是指他(她)的 <code>n</code> 篇论文中)<strong>总共</strong><code>h</code> 篇论文分别被引用了<strong>至少</strong> <code>h</code> 次。且其余的 <em><code>n - h</code> </em>篇论文每篇被引用次数 <strong>不超过 </strong><em><code>h</code> </em>次。</p>
<p><strong>提示:</strong>如果 <code>h</code><em> </em>有多种可能的值,<strong><code>h</code> 指数 </strong>是其中最大的那个。</p>
<p>请你设计并实现对数时间复杂度的算法解决此问题。</p>
<p> </p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入<code></code></strong><code>citations = [0,1,3,5,6]</code>
<strong>输出:</strong>3
<strong>解释:</strong>给定数组表示研究者总共有 <code>5</code> 篇论文,每篇论文相应的被引用了 0<code>, 1, 3, 5, 6</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,2,100]
<strong>输出:</strong>2
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>n == citations.length</code></li>
<li><code>1 <= n <= 10<sup>5</sup></code></li>
<li><code>0 <= citations[i] <= 1000</code></li>
<li><code>citations</code><strong>升序排列</strong></li>
</ul>