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.