Skip to content
← Back to the archive

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 numbers
  • Plot names are lowercase strings

Function signature

def garden_goals(records, goal):

Sign in to solve this bracket

Reading the problem is free for everyone. Opening the editor and solving it requires an account with Open Bracket+.