why are 2 test cases not passing?
Balanced Paranthesis
@akankshaanand99
There was a minor mistake, while taking the inputs.
Also, Try to use string wherever possible and avoid char*.
It worked! But why didn’t taking input a char array work?
@akankshaanand99
because you used cin.getline(a, 10);
it takes the first 10 characters of the line.
it would have worked if you used cin>>a;
Its a general practice to use strings,vectors wherever possible.
1 Like
Alright, got it! Thank you.
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.