H指数
解题思路:
func hIndex(citations []int) int {
sort.Ints(citations)
max := 0
length := len(citations)
for idx, item := range citations {
count := length - idx
if item >= count && count > max {
max = count
}
}
return max
}复杂度分析一
最后更新于