Please check the code

few testcases are passing

Hello @tharun,

Your logic is incorrect.
The following code, is causing error.
else if(cu==’)’ or ‘}’ or ‘]’){
if(s.empty() || s.top()!=’(’||s.top()!= ‘{’ ||s.top()!= ‘[’){
return false;
}
s.pop();
}

This code will execute successfully even if you’ll get different sets of pair like {,) and [,).

Solution:
for (, the closing bracket should only be )
similarly for other kinds of brackets.

Hope, this would help.
Give a like if you are satisfied.

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.