Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def f(start_pos, current_pos):
- if start_pos == current_pos:
- return 1
- if start_pos > current_pos:
- return 0
- k = f(start_pos, current_pos-1)
- k += f(start_pos, current_pos-2)
- if current_pos % 2 == 0:
- k += f(start_pos, current_pos//2)
- return k
- print(f(3, 10)*f(10, 12))
Advertisement
Add Comment
Please, Sign In to add comment