标签:
public class Solution { public int hIndex(int[] citations) { int length = citations.length; int[] record = new int[length + 1]; for (int i = 0; i < length; i++) { if (citations[i] >= length) { record[length] ++; } else { record[citations[i]] ++; } } int count = 0; for (int i = length; i >= 0; i--) { count += record[i]; if (count >= i) { return i; } } return 0; } }
标签:
原文地址:http://www.cnblogs.com/vision-love-programming/p/4996527.html