function solution(d, budget) { let answer = 0; d.sort((x, y) => x - y); for(let i of d){ budget -= i; budget >= 0 && answer++; } return answer; }
성공