Search⌘ K
AI Features

Solution: H-Index

Explore how to calculate the h-index of a researcher by applying a counting sort strategy that counts citation frequencies instead of directly sorting. Understand how to use a bucket array and reverse accumulation to find the highest h-index efficiently. This lesson will help you implement an optimized O(n) time solution and grasp the tradeoffs between time and space complexity for coding interview problems.

Statement

You are given an array of integers citations, where each element citations[i] represents the number of citations received for the ithi^{th} publication of a researcher.

Your task is to find the researcher’s h-index and return the value of hh.

Note: The h-index is defined as the highest number hh such that the given researcher has published at least hh papers, each of which has been cited at least hh times.

Constraints:

  • n==n == citations.length

  • ...