H-Index
Solve this the way you would in the interview: out loud, on a timer, with an AI interviewer asking follow-ups while you code. You get a scored report at the end.
Practice this as a mock interviewFree to start, no account neededProblem
A researcher has published n papers, and citations[i] is the number of times paper i has been cited. Their h-index is the largest integer h such that at least h of the papers have been cited at least h times each.
Return the researcher's h-index. Note that h can be 0 and can never exceed n. An O(n) solution is possible.
Examples
Constraints
- 1 <= citations.length <= 5000
- 0 <= citations[i] <= 1000
What the interviewer grades
A correct solution is one of five scores. The report also grades problem understanding (did you clarify inputs and edge cases before coding), problem solving, communication while you work, code quality, and testing. See a sample report, or read up on the pattern in the lessons.