Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Binaries solution in Clear category for Golden Pyramid by evoynov
def count_gold(p):
path = 1 << len(p)
res = 0
while bin(path).count("1") != len(p) + 1:
s = ind = 0
for row in range(len(p)):
ind += 1 if row > 0 and bin(path)[3:][row] == "1" else 0
s += p[row][ind]
res = max(res, s)
path += 1
return res
Feb. 11, 2015
Comments: