From c0675dccdb22fae6dc7ae86982b1969761cf3964 Mon Sep 17 00:00:00 2001 From: lkhyun <102892446+lkhyun@users.noreply.github.com> Date: Wed, 15 Oct 2025 20:35:09 +0900 Subject: [PATCH] =?UTF-8?q?[20251015]=20PGM=20/=20Lv2=20/=20=EC=A0=90?= =?UTF-8?q?=ED=94=84=EC=99=80=20=EC=88=9C=EA=B0=84=20=EC=9D=B4=EB=8F=99=20?= =?UTF-8?q?/=20=EC=9D=B4=EA=B0=95=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...4\352\260\204 \354\235\264\353\217\231.md" | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 "lkhyun/202510/15 PGM Lv2 \354\240\220\355\224\204\354\231\200 \354\210\234\352\260\204 \354\235\264\353\217\231.md" diff --git "a/lkhyun/202510/15 PGM Lv2 \354\240\220\355\224\204\354\231\200 \354\210\234\352\260\204 \354\235\264\353\217\231.md" "b/lkhyun/202510/15 PGM Lv2 \354\240\220\355\224\204\354\231\200 \354\210\234\352\260\204 \354\235\264\353\217\231.md" new file mode 100644 index 00000000..8d4a220c --- /dev/null +++ "b/lkhyun/202510/15 PGM Lv2 \354\240\220\355\224\204\354\231\200 \354\210\234\352\260\204 \354\235\264\353\217\231.md" @@ -0,0 +1,20 @@ +```java +import java.util.*; + +public class Solution { + public int solution(int n) { + int ans = 0; + + while(n>0){ + if(n%2==0){ + n /= 2; + }else{ + ans++; + n--; + } + } + + return ans; + } +} +```