π 2022λ 1μ 24μΌ
<script>
function solution(d, budget) {
var answer = 0;
d.sort((a,b) => a-b);
d.reduce((acc, v) => {
acc + v <= budget ? answer++ : {}
return acc + v
}, 0)
return answer;
}
</script>