Boss

Boss: The Supply Depot

The boss
Boss Fight!
Every passing test breaks a shield.

The Supply Depot on Harbor Island keeps every lantern in the archipelago fuelled, and today the quartermaster is off sick. A stack of orders has arrived, and you're in charge!

Each order is a tuple (action, item, qty). Process them in order:

  • "add": increase that item's stock by qty. New items start from 0.
  • "take": if there is at least qty in stock, subtract it. If the stock reaches exactly 0, delete the item from stock. If there isn't enough (or the item doesn't exist), don't change anything, append the item's name to shortages instead.

Assignment

  1. Process every order to update stock and shortages.
  2. Build low_stock: a set of items with fewer than 3 left.
  3. Count total_items: all quantities in stock added up.
  4. Print the report exactly like this:
=== Depot Report ===
lantern oil: 10
map: 1
rope: 3
Shortages: lantern oil, compass
Low stock: map
Items in depot: 14

Items are listed in alphabetical order (sorted(stock) gives you the keys sorted). Use ", ".join(...) for the comma lists.