Question - https://hack.codingblocks.com/contests/c/512/351
solution - https://ide.codingblocks.com/s/51545
my code is failing for 5th test case
Balanced Parenthesis - Recursion; not passing 5th test case
Hi Harsh, consider the following case:
{a+(b+c}+d)
The number of brackets in this problem are balanced but their order is not correct. So, the answer should be false, but your code gives true. You need to consider the order of the parenthesis as well.
can it be accomplished without using stack?
Yes, you can do it by using if-else conditions but you should use stack to solve this problem efficiently.