β back to unit
Easy
# stacks easy
The Pile Diary
The security camera photographs the top of the pile after every single move. πΈ
You get commands (add:x or take, takes valid). After EACH command print the current top β or empty if the pile is bare.
Example:
Input: commands = ["add:egg", "add:jam", "take", "add:tea"]
Output:
egg
jam
egg
tea
After each command we report the new top: add:egg β egg on top, add:jam β jam on top, take removes jam so egg is on top again, add:tea β tea on top.
π‘ need a hint?
stk-pile-diary.pyπ given lines are locked β write your code in between
loading...