We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3a01d85 commit 16413d5Copy full SHA for 16413d5
suyeun84/202509/10 PGM LV2 마법의 엘리베이터.md
@@ -0,0 +1,24 @@
1
+```java
2
+class Solution {
3
+ public int solution(int storey) {
4
+ int answer = 0;
5
+ while(storey > 0) {
6
+ int temp = storey % 10;
7
+ storey /= 10;
8
+
9
+ if (temp > 5) {
10
+ answer += (10-temp);
11
+ storey++;
12
+ } else if (temp < 5) {
13
+ answer += temp;
14
+ } else if (storey % 10 >= 5) {
15
+ answer += 5;
16
17
+ } else {
18
19
+ }
20
21
+ return answer;
22
23
+}
24
+```
0 commit comments