Skip to content

Commit 158e9b7

Browse files
committed
���몄���� / 以�
1 parent ecd38b3 commit 158e9b7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
function solution(n) {
2+
let result = [];
3+
let divisor = 2;
4+
5+
while (n > 1) {
6+
if (n % divisor === 0) {
7+
result.push(divisor);
8+
n /= divisor;
9+
} else {
10+
divisor++;
11+
}
12+
}
13+
14+
return [...new Set(result)];
15+
}

0 commit comments

Comments
 (0)