Skip to content

Instantly share code, notes, and snippets.

@mertyildiran
Created March 5, 2021 18:30
Show Gist options
  • Save mertyildiran/755438cdac0a3ab52e4e9808051d629d to your computer and use it in GitHub Desktop.
Save mertyildiran/755438cdac0a3ab52e4e9808051d629d to your computer and use it in GitHub Desktop.
Tak
def tak(x, y, z):
if y < x:
return tak(
tak(x-1, y, z),
tak(y-1, z, x),
tak(z-1, x, y)
)
else:
return z
print(tak(18, 12, 6))
print(tak(55, 49, 84))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment