From bc11513907c8d0166bd69c96cb4fb42789e8aa6e Mon Sep 17 00:00:00 2001 From: yeongjun Kim Date: Thu, 15 Jun 2023 23:59:55 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A0=80=EC=A3=BC=EC=9D=98=20=EC=88=AB?= =?UTF-8?q?=EC=9E=90=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Programmers/exam89.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Programmers/exam89.js diff --git a/Programmers/exam89.js b/Programmers/exam89.js new file mode 100644 index 0000000..ada9b38 --- /dev/null +++ b/Programmers/exam89.js @@ -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; +}