LeetCode #274: H-Index
• 31 words • 1 min • updated
python
class Solution:
def hIndex(self, citations: List[int]) -> int:
citations.sort(reverse=True)
h = 0
while h < len(citations):
if h < citations[h]:
h += 1
else:
break
return h∎
Connections
Shared tags