From c88eccb309b2c82a0ac6f7dcc6b95102f448b7a5 Mon Sep 17 00:00:00 2001 From: suyeun84 <81475092+suyeun84@users.noreply.github.com> Date: Wed, 10 Sep 2025 21:32:26 +0900 Subject: [PATCH] =?UTF-8?q?[20250910]=20PGM=20/=20LV2=20/=20=EB=A7=88?= =?UTF-8?q?=EB=B2=95=EC=9D=98=20=EC=97=98=EB=A6=AC=EB=B2=A0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=20/=20=EA=B9=80=EC=88=98=EC=97=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...54\353\262\240\354\235\264\355\204\260.md" | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 "suyeun84/202509/10 PGM LV2 \353\247\210\353\262\225\354\235\230 \354\227\230\353\246\254\353\262\240\354\235\264\355\204\260.md" diff --git "a/suyeun84/202509/10 PGM LV2 \353\247\210\353\262\225\354\235\230 \354\227\230\353\246\254\353\262\240\354\235\264\355\204\260.md" "b/suyeun84/202509/10 PGM LV2 \353\247\210\353\262\225\354\235\230 \354\227\230\353\246\254\353\262\240\354\235\264\355\204\260.md" new file mode 100644 index 00000000..3a584ff7 --- /dev/null +++ "b/suyeun84/202509/10 PGM LV2 \353\247\210\353\262\225\354\235\230 \354\227\230\353\246\254\353\262\240\354\235\264\355\204\260.md" @@ -0,0 +1,24 @@ +```java +class Solution { + public int solution(int storey) { + int answer = 0; + while(storey > 0) { + int temp = storey % 10; + storey /= 10; + + if (temp > 5) { + answer += (10-temp); + storey++; + } else if (temp < 5) { + answer += temp; + } else if (storey % 10 >= 5) { + answer += 5; + storey++; + } else { + answer += 5; + } + } + return answer; + } +} +```