mirror of
https://github.com/Alexander-D-Karpov/scripts.git
synced 2024-11-28 14:23:43 +03:00
11 lines
188 B
Python
11 lines
188 B
Python
|
def f(n, path):
|
||
|
if len(path) == 12:
|
||
|
return path
|
||
|
|
||
|
return f(n + 1, path + [n + 1]) + f(n - 1, path + [n - 1])
|
||
|
|
||
|
|
||
|
r = f(1, [])
|
||
|
print(len(r))
|
||
|
print(len(list(set(r))))
|