From 97976e239449d8d073820e1924c7157f3d116e7e Mon Sep 17 00:00:00 2001 From: Kaushik Narayan R Date: Tue, 3 Jun 2025 23:50:18 -0700 Subject: [PATCH] last of the day --- 274-h-index/soln.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 274-h-index/soln.py diff --git a/274-h-index/soln.py b/274-h-index/soln.py new file mode 100644 index 0000000..613130f --- /dev/null +++ b/274-h-index/soln.py @@ -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