Farz0l1x

Untitled

Feb 24th, 2023
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. def f(curr, end, step):
  2.     if curr > end:
  3.         return 0
  4.     if curr == end and step == 7:
  5.         return 1
  6.     if curr == end and step != 7:
  7.         return 0
  8.     if curr < end:
  9.         return f(curr + 1, end, step + 1) + f(curr + 4, end, step + 1) + f(curr * 2, end, step + 1)
  10. print(f(3, 27, 0))
Advertisement
Add Comment
Please, Sign In to add comment