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; + } +} +```