Skip to content

Commit

Permalink
저주의 숫자 3
Browse files Browse the repository at this point in the history
  • Loading branch information
dudwns committed Jun 15, 2023
1 parent fbb0c01 commit bc11513
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Programmers/exam89.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
function solution(n) {
let answer = 0;
for (let i = 1; i <= n; i++) {
answer += 1;
while (true) {
if (answer % 3 === 0 || String(answer).includes("3")) {
answer += 1;
continue;
}
break;
}
}
return answer;
}

0 comments on commit bc11513

Please sign in to comment.