Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Just Return Max Possible Sum solution in Clear category for Golden Pyramid by obone
def count_gold(pyramid, n = 0, p = 0):
"""
Return max possible sum in a path from top to bottom
"""
return pyramid[n][p] + \
max(count_gold(pyramid, n + 1, p), count_gold(pyramid, n + 1, p + 1)) \
if n < len(pyramid) else 0
July 6, 2019