programmers H-Index
분류 / 레벨 / 언어
정렬 / LV.2 / Javscript
설명
큰 순서대로 정렬한 후,
i를 올려가며 h인덱스의 조건을 만족하는지 검증한다.
h이상의 요소를 따로 count할 필요가 없는데
그 이유는, i를 1씩 올리는 것 자체가 count를 담고 있기 때문이다.
전체 코드
1 | function solution(citations) { |
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
