please explain the test cases
Please explain the test cases
@sharad1103
Sample Input
2
(((a+(b))+(c+d)))
((a+(b))+(c+d))
Sample Output
Duplicate
Not Duplicates
You just have to check here that if there are unnecessary parenthesis or not.
In the 1st case (((a+(b))+(c+d))) you can observe that the first parenthesis pair is not necessary(this expression could be represented by ((a+(b))+(c+d)) ) hence you have to print Duplicate.
In case 2 there is no unnecessary parenthesis so you print Not Duplicates
This problem is somewhat similar to the valid parenthesis problem using stack. Try to think out of a logic.
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.