the code is producing correct output for every input.But 2 of the four test cases are showing wrong answer.plzzz find the error
Https://ide.codingblocks.com/s/198610
If you encounter a closing brace and the stack is not empty, you have to check for the following conditions -
if(str[i]==β ) β ) && ( ch == β ( β )
And similarly for the other two types of braces as well.
For example -
( [ { } ] ) is balanced.
But ( [ { ] } ) is not balanced and your code displays βYesβ in this case.
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.