Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ssokolowskisebastian/0c82611869688b1758766b6d0d1e8d09 to your computer and use it in GitHub Desktop.
Save ssokolowskisebastian/0c82611869688b1758766b6d0d1e8d09 to your computer and use it in GitHub Desktop.
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