Find the Largest Supported Citation Threshold

Quick Overview

Find the Largest Supported Citation Threshold. Return the largest integer h for which at least h papers each have at least h citations. citations contains one nonnegative count per paper.

Find the Largest Supported Citation Threshold

Company: Google

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Other

### Problem Return the largest integer h for which at least h papers each have at least h citations. citations contains one nonnegative count per paper. ```cpp int hIndex(vector<int>& citations); ``` ### Examples ```text citations = [4,0,4,2,1] -> 2 citations = [0,0] -> 0 ``` ### Constraints - There are 1 through 5000 papers. - Each citation count is in [0,1000].

Overview: Find the Largest Supported Citation Threshold. Return the largest integer h for which at least h papers each have at least h citations. citations contains one nonnegative count per paper.

Google logo
Google
Source window: 0–6 months · as of Oct 21, 2026
mediumSoftware EngineerOtherCoding & Algorithms
1
0

Problem

Return the largest integer h for which at least h papers each have at least h citations. citations contains one nonnegative count per paper.

int hIndex(vector<int>& citations);

Examples

citations = [4,0,4,2,1] -> 2
citations = [0,0] -> 0

Constraints

  • There are 1 through 5000 papers.
  • Each citation count is in [0,1000].