标签:
https://leetcode.com/problems/h-index/
class Solution { public: int hIndex(vector<int>& citations) { int size=citations.size(); int index=size; bool flag=false; while(index>0) { int count=0; for(int i=0;i<size;i++) { if(citations[i]>=index) count++; } if(index<=count) break; index--; } return index; } };
标签:
原文地址:http://www.cnblogs.com/aguai1992/p/5023795.html