Skip to content

Commit 94d21fd

Browse files
refactor 274
1 parent 1387c0f commit 94d21fd

File tree

1 file changed

+0
-15
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-15
lines changed

src/main/java/com/fishercoder/solutions/_274.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,6 @@
22

33
import java.util.Arrays;
44

5-
/**
6-
* 274. H-Index
7-
*
8-
* 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.
9-
* 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."
10-
* 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.
11-
* 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.
12-
13-
Note: If there are several possible values for h, the maximum one is taken as the h-index.
14-
15-
Hint:
16-
An easy approach is to sort the array first.
17-
What are the possible values of h-index?
18-
A faster approach is to use extra space.
19-
*/
205
public class _274 {
216
public static class Solution1 {
227
public int hIndex(int[] citations) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy