Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- counter = 0
- my_min = None
- def recursion(X,Y):
- global counter
- if X == 1 and Y == 1:
- counter += 1
- elif X > 0 and Y > 0:
- counter += 1
- my_min = min(X,Y)
- solution(my_min, abs(X-Y))
- else:
- counter = float("inf")
- return counter - 1
- def solution(X,Y):
- my_sol = recursion(int(X),int(Y))
- if my_sol == float("inf"):
- return "impossible"
- else:
- return str(my_sol)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement