Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
One liner solution in Creative category for Golden Pyramid by Sim0000
count_gold=f=lambda p,n=0,x=0,s=0:s if n==len(p) else max(f(p,n+1,x,s+p[n][x]),f(p,n+1,x+1,s+p[n][x]))
"""
# decrypted version
def count_gold(pyramid, level = 0, pos = 0, total = 0):
if level == len(pyramid): return total
total += pyramid[level][pos]
return max(count_gold(pyramid, level + 1, pos, total),
count_gold(pyramid, level + 1, pos + 1, total))
"""
April 30, 2014
Comments: