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; } };