프로그래머스[Level1] 예산
function solution(d, budget) { d.sort((a,b)=>{return a-b}); let result=0; let cnt=0; for (let i=0;i<d.length;++i){ result+=d[i]; if(result<=budget){ cnt++; } } return cnt; }