From a0ef929af2ce76d277a73afad3e998cb3396652f Mon Sep 17 00:00:00 2001 From: LiiNi-coder <97495437+LiiNi-coder@users.noreply.github.com> Date: Fri, 31 Oct 2025 22:15:04 +0900 Subject: [PATCH] =?UTF-8?q?[20251031]=20PGM=20/=20LV2=20/=20=EC=A0=90?= =?UTF-8?q?=ED=94=84=EC=99=80=20=EC=88=9C=EA=B0=84=EC=9D=B4=EB=8F=99=20/?= =?UTF-8?q?=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 --- ...34\352\260\204\354\235\264\353\217\231.md" | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 "LiiNi-coder/202510/31 PGM \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/LiiNi-coder/202510/31 PGM \354\240\220\355\224\204\354\231\200 \354\210\234\352\260\204\354\235\264\353\217\231.md" "b/LiiNi-coder/202510/31 PGM \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..eec98679 --- /dev/null +++ "b/LiiNi-coder/202510/31 PGM \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,19 @@ +```java +import java.util.*; + +public class Solution { + public int solution(int n) { + int ans = 0; + + while(n != 0){ + if(n%2 != 0){ + n--; + ans++; + } + n/=2; + } + + return ans; + } +} +```