classSolution { public: inthIndex(vector<int>& citations){ int sz = citations.size(); int ans = 0; sort(citations.begin(), citations.end()); for (int i = sz - 1; i >= 0; i--) { int index = sz - i; ans = max(ans, min(citations[i], index)); if (citations[i] < index) { break; } } return ans; } };