Incorrect output - every testcase interpreted as duplicate

All the testcases are interpreted as duplicate, can you please help me find the error

Hey @prerna_gupta31 there’s no need of dealing with ‘+’ character in your else if loop of line 40 your logic isn’t right for if and else if statement. Take reference from this

I understood your code… but what was wrong with my logic? can you please explain…?

There was no need to handle cases having ‘+’ character as I told. Also you haven’t deal with the case that if you found str[i] = ‘(‘ & your s.top is ‘(‘ you have to pop using while loop like in my code line number 28