Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 061e659cfb
Fetching contributors…

Cannot retrieve contributors at this time

19 lines (14 sloc) 0.353 kB
def sum_word(word):
return sum(map(lambda x: (ord(x) - 64), word))
triangles = [1]
for i in range(2, 20):
triangles.append(i + triangles[i - 2])
total = 0
f = open("words.txt", "r")
words = f.read()
words = words.replace('"', '')
words = words.split(',')
for word in words:
if sum_word(word) in triangles:
total += 1
print total
Jump to Line
Something went wrong with that request. Please try again.