Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Golden Pyramid by eniserd
def count_gold(pyramid):
sums = [0]*len(pyramid)
s = [0]*len(pyramid)
for t in pyramid:
for i,v in enumerate(t):
s[i] = t[i] + max(sums[i], sums[i-1])
sums = s[:]
return max(sums)
Jan. 5, 2015