← back to unit
Easy
# stacks easy
The Plate Dispenser
The cafeteria dispenser: clean plates get pushed in on top, hungry kids take from the top. 🍽️
You get commands — add:blue pushes a blue plate, take removes the top one (there's always one to take). Print the final pile bottom to top, comma-separated, or empty.
Example:
Input: commands = ["add:blue", "add:red", "take", "add:green"]
Output: blue,green
Push blue, push red, take removes red (the current top), then push green — leaving blue on the bottom and green on top: blue,green.
💡 need a hint?
stk-plate-dispenser.py🔒 given lines are locked — write your code in between
loading...