You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Given an array of citations sorted in ascending order (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index.
5
+
*
6
+
* According to the <a href="https://en.wikipedia.org/wiki/H-index" target="_blank">definition of h-index on Wikipedia</a>: "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."
7
+
*
8
+
* Example:
9
+
*
10
+
*
11
+
* Input: citations = [0,1,3,5,6]
12
+
* Output: 3
13
+
* Explanation: [0,1,3,5,6] means the researcher has 5 papers in total and each of them had
14
+
* received 0, 1, 3, 5, 6 citations respectively.
15
+
* Since the researcher has 3 papers with at least 3 citations each and the remaining
16
+
* two with no more than 3 citations each, her h-index is 3.
17
+
*
18
+
* Note:
19
+
*
20
+
* If there are several possible values for h, the maximum one is taken as the h-index.
21
+
*
22
+
* Follow up:
23
+
*
24
+
*
25
+
* This is a follow up problem to <a href="/problems/h-index/description/">H-Index</a>, where citations is now guaranteed to be sorted in ascending order.
26
+
* Could you solve it in logarithmic time complexity?
0 commit comments