30 August 2026
Garden Goals
Hard
Dictionaries
Find garden plots that reached a harvest goal.
You are given harvest records. Each record contains a plot name and a whole-number harvest amount. First, add together the harvest amounts for each plot. Then return the plot names whose total is at least the goal, keeping the order in which each plot first appears. Return an empty list when no plot reaches the goal.
Constraints
Harvest amounts are non-negative whole numbersPlot names are lowercase strings
Function signature
def garden_goals(records, goal):