last of the day

This commit is contained in:
Kaushik Narayan R 2025-06-03 23:50:18 -07:00
parent 151d0214ff
commit 97976e2394

9
274-h-index/soln.py Normal file
View File

@ -0,0 +1,9 @@
def hIndex(self, citations: list[int]) -> int:
cs = sorted(citations, reverse=True)
h = 0
for x in cs:
if x > h:
h += 1
else:
break
return h