I ran the code but I passed only the 3rd and 4th test cases but when I downloaded the test cases and ran it again manually with my code I am passing other 1st and 2nd test case also. Why is this ?
Balanced Parenthesis
Can you explain me why is this happening?
There is problem in your implementation.
Run your code for cases like ((}} or [[)} or [[[))) . in all these cases your code should return “Yes” But the answer is “No”.
you haven’t handled different types of brackets individually. you mixed them and thats the problem.
Thanks.