274. H-Index
mediumArray · Sorting · Counting Sort
read the problem on leetcode →
first solved 10 Sept 2026
class Solution:
def hIndex(self, citations: List[int]) -> int:
# max of x such that x is atleast n with x citation
citations.sort(reverse=True)
h=0
for i in range(0,len(citations)):
if citations[i]>=i+1:
h=i+1
else:
break
return h