Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Golden Pyramid by UFO665
def count_gold(pyramid):
lst = [pyramid[0][0]]
i = 1
while i < len(pyramid):
newList = []
for j, elem in enumerate(lst):
newList += [elem + pyramid[i][j], elem + pyramid[i][j + 1]]
lst = [newList[0]] + [max(newList[j], newList[j + 1]) for j in range(1, len(newList) - 1, 2)] + [newList[-1]]
i += 1
return max(lst)
Dec. 13, 2015