Created
November 18, 2025 05:54
-
-
Save unacceptable/b76cfd576a26bb713c3d1f80cec1da9c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from functools import lru_cache | |
| @lru_cache(maxsize=None) | |
| def fibonacci(n: int) -> int: | |
| ''' | |
| Return the n-th Fibonacci number. | |
| ''' | |
| if n == 0: | |
| return 0 | |
| elif n == 1: | |
| return 1 | |
| return fibonacci(n - 1) + fibonacci(n - 2) | |
| result = fibonacci(1000) | |
| if result == 43466557686937456435688527675040625802564660517371780402481729089536555417949051890403879840079255169295922593080322634775209689623239873322471161642996440906533187938298969649928516003704476137795166849228875: | |
| print("Success: https://youtu.be/2RQTq07B3oo") | |
| else: | |
| print(f"Failure: https://youtu.be/zSQNl4V_R88?t=58") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment