Skip to content

Commit

Permalink
약수 구하기
Browse files Browse the repository at this point in the history
  • Loading branch information
dudwns committed Apr 21, 2023
1 parent 48b9940 commit 881358b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Programmers/exam56.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function solution(n) {
var answer = [];
for (let i = 1; i <= n; i++) {
n % i === 0 ? answer.push(i) : null;
}
return answer;
}

0 comments on commit 881358b

Please sign in to comment.