Skip to content

Commit b34a827

Browse files
committed
102차 3번 문제풀이(푸는중)
1 parent 1a454b3 commit b34a827

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from collections import *
2+
3+
def solution(x, y, n):
4+
answer = 0
5+
result = []
6+
7+
q = deque([x])
8+
while q:
9+
x = q.popleft()
10+
calculate = [x + n, x * 2, x * 3]
11+
cnt = 0
12+
for i in range(3):
13+
cnt += 1
14+
nx = calculate[i]
15+
if nx == y:
16+
return cnt
17+
else:
18+
q.append(nx)
19+
20+
return answer

0 commit comments

Comments
 (0)