Skip to content

Commit 9ea3541

Browse files
committed
[Add] Programmers > Level1
1 parent f70ce72 commit 9ea3541

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Programmers/Level1/Q45.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Q45. 에산
2+
3+
function solution(d, budget) {
4+
var answer = 0;
5+
6+
d.sort((a, b) => a - b);
7+
d.forEach((e) => {
8+
if (e <= budget) {
9+
budget -= e;
10+
answer++;
11+
}
12+
});
13+
14+
return answer;
15+
}

0 commit comments

Comments
 (0)