Farz0l1x

Untitled

Feb 24th, 2023
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. from functools import *
  2. s = set()
  3. @lru_cache(None)
  4. def f(curr, step):
  5.     if step == 15:
  6.         s.add(curr)
  7.     else:
  8.         f(curr * 2, step + 1)
  9.         f(curr * 2 + 1, step + 1)
  10. f(1, 0)
  11. print(len(s))
Advertisement
Add Comment
Please, Sign In to add comment