Skip to content

Commit

Permalink
공 던지기
Browse files Browse the repository at this point in the history
  • Loading branch information
dudwns committed May 10, 2023
1 parent daf131f commit 86c8916
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Programmers/exam73.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function solution(numbers, k) {
var answer = 1;
for (let i = 1; i < k; i++) {
answer += 2;
if (answer === numbers.length + 1) answer = 1;
else if (answer === numbers.length + 2) answer = 2;
}
return answer;
}

0 comments on commit 86c8916

Please sign in to comment.