Redundant parenthesis

getting wrong output.

Hey
in your main function-
you have to take input in the following way-
input t strings
int main() {

int n, t;

cin >> t;

while (t--)

{

   string arr;

    cin >> arr;

    isduplicate(arr) ? cout << "Duplicate\n" : cout << "Not Duplicates\n";

}

}

@mahimahans111
now also getting wrong output

hey your logic is not correct:-
You should go like this:-
1 If current character is close parenthesis ‘)’
pop character from the stack
no check-
if immediate pop is a open parenthesis ‘(’, we have found duplicate, so return true
else we continue popping characters from the stack till open parenthesis ‘(’ is
encountered

2 else push open parenthesis ‘(’, operators and

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.