Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
recursive one_liner solution in Clear category for Golden Pyramid by rafal.pawlowski
def count_gold(pyramid, row = 0, column = 0):
return pyramid[row][column] + max(count_gold(pyramid, row + 1, column), count_gold(pyramid,row + 1, column + 1)) if row < len(pyramid) - 1 else pyramid[row][column]
July 7, 2019
Comments: