From 2ed5c75a3a8bbf8ad0548b86f407d852e35a2061 Mon Sep 17 00:00:00 2001 From: sik9252 Date: Wed, 22 Apr 2026 19:01:51 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=EC=88=AB=EC=9E=90=EC=9D=98=20?= =?UTF-8?q?=ED=91=9C=ED=98=84=20=ED=92=80=EC=9D=B4=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0\354\235\230_\355\221\234\355\230\204.js" | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 "sik9252/\354\210\253\354\236\220\354\235\230_\355\221\234\355\230\204.js" diff --git "a/sik9252/\354\210\253\354\236\220\354\235\230_\355\221\234\355\230\204.js" "b/sik9252/\354\210\253\354\236\220\354\235\230_\355\221\234\355\230\204.js" new file mode 100644 index 0000000..b54c1e4 --- /dev/null +++ "b/sik9252/\354\210\253\354\236\220\354\235\230_\355\221\234\355\230\204.js" @@ -0,0 +1,22 @@ +function solution(n) { + let answer = 0; + let left = 1; + let right = 1; + let sum = 1; + + while (left <= n) { + if (sum === n) { + answer++; + sum -= left; + left++; + } else if (sum < n) { + right++; + sum += right; + } else { + sum -= left; + left++; + } + } + + return answer; +} From fc8a15f0144baabc5a4a9ea93c43f950038ba118 Mon Sep 17 00:00:00 2001 From: sik9252 Date: Wed, 22 Apr 2026 19:01:57 +0900 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=EB=8B=A4=EC=9D=8C=20=ED=81=B0=20?= =?UTF-8?q?=EC=88=AB=EC=9E=90=20=ED=92=80=EC=9D=B4=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...235\214_\355\201\260_\354\210\253\354\236\220.js" | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 "sik9252/\353\213\244\354\235\214_\355\201\260_\354\210\253\354\236\220.js" diff --git "a/sik9252/\353\213\244\354\235\214_\355\201\260_\354\210\253\354\236\220.js" "b/sik9252/\353\213\244\354\235\214_\355\201\260_\354\210\253\354\236\220.js" new file mode 100644 index 0000000..a25d57f --- /dev/null +++ "b/sik9252/\353\213\244\354\235\214_\355\201\260_\354\210\253\354\236\220.js" @@ -0,0 +1,12 @@ +function solution(n) { + const countOne = (num) => num.toString(2).split("1").length - 1; + + const target = countOne(n); + let next = n + 1; + + while (countOne(next) !== target) { + next++; + } + + return next; +}