Created
March 28, 2012 17:49
-
-
Save Roasbeef/2228671 to your computer and use it in GitHub Desktop.
Project Euler Problem #16 Solution
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
#Sum of digits of 2^1000 | |
from functools import reduce | |
#Solution Number:1 | |
reduce(lambda a,b: a+b, [int(x) for x in str(2**1000)]) | |
#Solution Number:2 | |
sum([int(x) for x in str(2**1000)]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment