Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Exhaustive solution in Uncategorized category for Golden Pyramid by Sim0000
def count_gold(pyramid):
def seek(level, pos, total):
nonlocal maxvalue
if level == goal:
maxvalue = max(maxvalue, total)
return
seek(level + 1, pos, total + pyramid[level][pos])
seek(level + 1, pos + 1, total + pyramid[level][pos + 1])
maxvalue = 0
goal = len(pyramid)
seek(1, 0, pyramid[0][0])
return maxvalue
April 30, 2014
Comments: