Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Golden Pyramid by m600
def count_gold(pyramid):
pyramid = [list(tup) for tup in pyramid]
for i in range(1, len(pyramid)):
for j in range(0, i+1):
k = j-1
if k < 0:
k = 0
l = j
if l == len(pyramid[i-1]):
l -= 1
pyramid[i][j] = max(pyramid[i][j] + pyramid[i-1][k], pyramid[i][j] + pyramid[i-1][l])
return max(max(pyramid))
July 5, 2015
Comments: