Created
June 27, 2014 05:43
-
-
Save OscarGodson/6ea65836f26c50712939 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
def sum(a, b): return a + b | |
def stringSum(s): | |
numArray = list(str(s)) | |
return reduce(sum, map(lambda s: int(s), numArray)) | |
print stringSum(2**1000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment