Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Golden Pyramid by MMM_AAA_NNN
def count_gold (pyramid):
height = len(pyramid)
choices = 0
for pathchoice in range(pow(2, height-1)):
path = bin(pathchoice)[2:].zfill(height)
choices = max(choices, path_gold(path,pyramid))
return choices
def path_gold(path, pyramid):
gold = 0
pos = 0
for i in range(len(pyramid)):
pos += int(path[i])
gold += pyramid[i][pos]
return gold
March 23, 2015
Comments: