← back to unit
Medium
# stacks medium
Two Piles, One Kitchen
Two dish piles: one for plates, one for pans — commands come with an address. 🍳
You get commands like a:add:fork, b:add:pot, a:take, b:take (takes valid). Print pile A on line one and pile B on line two (bottom to top, comma-separated, or empty).
Example:
Input: commands = ["a:add:fork", "b:add:pot", "a:add:cup", "a:take"]
Output:
fork
pot
Pile A gets fork then cup; a:take removes cup, leaving just fork. Pile B just has pot.
💡 need a hint?
stk-two-piles.py🔒 given lines are locked — write your code in between
loading...