Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit94d21fd

Browse files
refactor 274
1 parent1387c0f commit94d21fd

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
importjava.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
publicclass_274 {
216
publicstaticclassSolution1 {
227
publicinthIndex(int[]citations) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp