Leetcode 274. H 指数

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
}

  

posted @ 2022-05-10 04:51  SoutherLea  阅读(19)  评论(0编辑  收藏  举报