Meena Aunty runs a Diwali gift shop in Jaipur. She packs gifts in boxes inside boxes.
She has three box shapes: round ( ), square [ ] and curly { }. Each order has a packing list of these symbols. An opening symbol opens a new box. It goes inside the newest open box, or on the counter if no box is open. A closing symbol is a lid for the newest box that is still open. The boxes inside must be closed first.
A round lid does not fit a square box. A lid with no open box is a mistake. So is a box left open at the end. Her helper Raju often misses these mistakes. Write a program to check each list.
![A gift stall at a Diwali night market. A packing list shows the symbols ( [ ] ) { }. A closed round box holds a closed square box. An open curly box stands next to it.](https://res.cloudinary.com/dgilboold/image/upload/f_auto,q_auto/v1793704455/cs-learning-portal/stories/gift-boxes-poster.webp)