Created
September 1, 2015 07:18
-
-
Save anirudhjayaraman/d7d54274ed8b9f861cf2 to your computer and use it in GitHub Desktop.
Project Euler Problem 13
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
# Read the problem matrix into an array in python | |
filename = 'euler13.txt' | |
with open(filename, "r") as ins: | |
array = [] | |
for line in ins: | |
array.append(line) | |
# Convert the array into an array of integers | |
newArray = [] | |
for i in array: | |
newArray.append(int(i)) | |
# Sum up the array and print the first 10 numbers of the sum as a string | |
arraySum = sum(newArray) | |
print str(arraySum)[:10] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment