H-Index

Time Complexity

class Solution: 
	def hIndex(self, citations: List[int]) -> int: n = len(citations) 
		c = 0 citations = sorted(citations, reverse = True) 
		for i in range(n): 
			if i+1 <= citations[i]: c += 1 
		return c

Related: