From 68bc0f0c01bf2546843b2951f79885abde6b8dee Mon Sep 17 00:00:00 2001 From: LiiNi-coder <97495437+LiiNi-coder@users.noreply.github.com> Date: Mon, 20 Oct 2025 21:51:52 +0900 Subject: [PATCH] =?UTF-8?q?[20251020]=20PGM=20/=20LV2=20/=20=EC=9D=B4?= =?UTF-8?q?=EC=A7=84=20=EB=B3=80=ED=99=98=20=EB=B0=98=EB=B3=B5=ED=95=98?= =?UTF-8?q?=EA=B8=B0=20/=20=EC=9D=B4=EC=9D=B8=ED=9D=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...30\353\263\265\355\225\230\352\270\260.md" | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 "LiiNi-coder/202510/20 PGM \354\235\264\354\247\204 \353\263\200\355\231\230 \353\260\230\353\263\265\355\225\230\352\270\260.md" diff --git "a/LiiNi-coder/202510/20 PGM \354\235\264\354\247\204 \353\263\200\355\231\230 \353\260\230\353\263\265\355\225\230\352\270\260.md" "b/LiiNi-coder/202510/20 PGM \354\235\264\354\247\204 \353\263\200\355\231\230 \353\260\230\353\263\265\355\225\230\352\270\260.md" new file mode 100644 index 00000000..89e36e93 --- /dev/null +++ "b/LiiNi-coder/202510/20 PGM \354\235\264\354\247\204 \353\263\200\355\231\230 \353\260\230\353\263\265\355\225\230\352\270\260.md" @@ -0,0 +1,31 @@ +```java +import java.util.*; + +class Solution { + public int[] solution(String s) { + int[] answer = new int[]{0, 0}; + + while(!"1".equals(s)){ + // 1개수 확인 + int oneCount = 0; + for(int i = 0; i1){ + sb.append(Integer.toString(oneCount % 2)); + oneCount /= 2; + } + sb.append(Integer.toString(oneCount)); + sb.reverse(); + s = sb.toString(); + answer[0]++; + } + + return answer; + } +} +```