274. H 指数 - 力扣(LeetCode)
思路
func hIndex(citations []int) int {
h := 0
sort.Ints(citations)
for i := len(citations) - 1; i >= 0 && citations[i] > h; i-- {
h++
}
return h
}
标签:sort,return,指数,int,citations,274,&&,Leetcode
来源: https://www.cnblogs.com/lizhengnan/p/16251951.html