test case is satisfying but it is showing wrong answer help please
Help me with this redundant parenthesis question
Dhruv your logic is little bit wrong, plz refer to this piece of code for changes that you need to make in your codeβ¦
else
{
if(!s.empty())
{
if(ch==β)β)
{
char top=s.top();
if(s.top()==β(β)
{
return true;
}
else
{
while(s.top()!=β(β && !s.empty())
{
s.pop();
}
s.pop();
}
}