Test case1 not working

in your code, you didn’t check for cases when the brackets are β€˜{’ or β€˜[’ , you have only taken the case for this bracket - β€˜(’.

I also suggest you to write separate functions
(i) For checking if the current char is bracket is opening or closing.
(ii) For matching while popping that the current char bracket is matching with the top or not, like if current char is β€˜}’ then match with the stack top if it is β€˜{’ or not.

if you have any other confusion in this, please ask

Please mark it as resolved if you don’t have any other doubt.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.