Skip to content

Commit 911f1e2

Browse files
committed
solve: week 31 문제 해결
1 parent 6554a07 commit 911f1e2

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
function solution(num_list, n) {
2+
return num_list.slice(n-1, num_list.length)
3+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
function solution(num_list) {
2+
for (let i of num_list) {
3+
if (Math.sign(i) === -1) {
4+
return num_list.indexOf(i);
5+
}
6+
}
7+
return -1;
8+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
function solution(n) {
2+
let x = 1;
3+
while (n % x !== 1) {
4+
x++;
5+
}
6+
return x;
7+
}

0 commit comments

Comments
 (0)