Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
dynamic programming solution in Clear category for Golden Pyramid by David_Jones
def count_gold(pyramid):
pyramid = list(map(list, pyramid))
for i in range(len(pyramid)-2, -1, -1):
for j in range(i+1):
pyramid[i][j] += max(pyramid[i+1][j], pyramid[i+1][j+1])
return pyramid[0][0]
May 21, 2019
Comments: