Created
May 12, 2025 11:06
-
-
Save ssokolowskisebastian/0c82611869688b1758766b6d0d1e8d09 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
import time | |
start_time = time.time() | |
def factorial(n): | |
if n == 1: | |
return 1 | |
return n*factorial(n-1) | |
def solution(n): | |
return sum(map(int, str(factorial(n)))) | |
print(solution(100)) | |
print("--- %s seconds ---" % (time.time() - start_time)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment