Skip to content

Commit

Permalink
#13 22.08.24 > H-Index
Browse files Browse the repository at this point in the history
  • Loading branch information
beurmuz committed Aug 24, 2022
1 parent e04588f commit 4c335b6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/programmers/Lv_2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
|19|[다리를 지나는 트럭](./passingTruck.js)|22.08.15|X|스택, 다시풀기|
|20|[큰 수 만들기](./makeBigNumber.js)|22.08.15|X|그리디|
|21|[카카오 튜플](./tuple.js)|22.08.22||한번더|
|22|[멀쩡한 사각형](./rightRect.js)|22.08.23|O|한번더|
|22|[멀쩡한 사각형](./rightRect.js)|22.08.23|O|한번더|
|23|[H-Index](./hindex.js)|22.08.24||한번더|
12 changes: 12 additions & 0 deletions src/programmers/Lv_2/hindex.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use strict';

function solution(citations) {
let answer = 0;
citations.sort((a, b) => b-a);
let h = 0;
while(h+1 <= citations[h]) {
h++;
}
answer = h
return answer;
}

0 comments on commit 4c335b6

Please sign in to comment.