Implement it using stacks or queues?

I wrote the code -


it’s working fine and i submmited it. I just want to ask how can we implement it using stacks or queues?

@payal_05 make a stack of char and iterate given string, whenever you find an opening bracket of any type push it into stack and when you found a closing bracket check if stack have an opening bracket of same type in top to balance that closing bracket if not found that opening bracket return false else continue.