Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Second solution in Clear category for Golden Pyramid by kurosawa4434
def count_gold(pyramid, r=0, c=0, golds=0, max_golds=0):
golds += pyramid[r][c]
if r == len(pyramid) - 1:
return max(max_golds, golds)
return max(count_gold(pyramid, r + 1, c, golds, max_golds),
count_gold(pyramid, r + 1, c + 1, golds, max_golds))
Aug. 15, 2016