Balanced Paranthesis

Refer this code - https://ide.codingblocks.com/s/413885

Please read the comments mentioned in lines 15 - 18 and help me out.

Thanks in advance.

Please mention the test case for which you are saying as it will be easy to elaborate.
Also check this, if this solves your query

Why it’s not working in the case when I’m taking input using for loop?

You are iterating for loop from 0 to 100, and if you aren’t giving any input then array will have garbage value. Also we have to give input as a string, so try to input like this only

Thanks for the clarification. I’m closing the doubt.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.