Skip to content

Commit f941bf7

Browse files
authored
Create 0274-H-index.py
1 parent de6010f commit f941bf7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: python/0274-H-index.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Solution:
2+
def hIndex(self, citations: List[int]) -> int:
3+
length = len(citations)
4+
citations.sort()
5+
for i in range(length):
6+
if citations[i] >= length - i:
7+
return length - i
8+
return 0

0 commit comments

Comments
 (0)