레벨 1짜리 문제다.
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int solution(vector<int> d, int budget) {
int answer = 0;
int ac = 0;
sort(d.begin(), d.end());
for(auto it : d) {
if(ac + it > budget)
break;
ac += it;
answer++;
}
return answer;
}