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