Please check the error and It is not passing this "()" test case

Balanced Paranthesis questions:

@rssrivastavarohan,
Mind the bracket in the program, e.g, why does your class includes main…??

bro Im solving this problem:

Please remove main and compile the code is not working for “()” test case.

@rssrivastavarohan,
else if(matching(str[i],s1.top())==false)
should be
else if(matching(s1.top(),str[i])==false)

Try to Dry run on paper and pen, at least when you know on which case your code fails.