Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Golden Pyramid by AmaroVita
def weight(path,pyramid):
i=0
w=0
for x in range(len(pyramid)):
w+=pyramid[x][i]
i+=(path>>x)%2
return w
def count_gold(pyramid):
N=2**(len(pyramid)-1)
M=0
for x in range(N):
w=weight(x,pyramid)
if w>M:
M=w
return M
Feb. 27, 2015
Comments: