https://programmers.co.kr/learn/courses/30/lessons/42747
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
bool compare(int a, int b) { return a > b; }
int solution(vector<int> citations) {
sort(citations.begin(), citations.end(), compare);
for (int i = 0; i < citations.size(); ++i) {
if (citations[i] <= i + 1) {
return i;
}
}
}
이 문제는 문제를 이해하는게 제일 어려웠어요 H-index란 개념을 처음 들어본건 당연한거고 이게 또 실제로 있는 개념이더라고요 https://en.wikipedia.org/wiki/H-index
아무튼 문제만 이해를 하면 구현자체는 어렵지 않습니다 뽀인트는 h값이 꼭 citations안에 있지는 않다는 겁니다 몇번을 읽어도 적응이 안되네요