H-Index II LeetCode solution in Python

1
import bisect
2

3

4
class Solution:
5
def hIndex(self, citations: List[int]) -> int:
6
n = len(citations)
7
for h in range(n, -1, -1):
8
if h <= n - bisect.bisect_left(citations, h):
9
return h

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0