Redundant paranthesis in stack

https://ide.codingblocks.com/s/364121 is giving wrong output for ((a+(b))+(c+d))

hello @shrutikatyal
check now->

https://ide.codingblocks.com/s/364168 still its not passing test cases

print output for each test case in seprate line.

ur updated code ->

#include<iostream>
#include<stack>
#include<cstring>
using namespace std;
int main()
 {
	 int t;
	 cin>>t;
	 for(int j=0;j<t;j++)
	 {
		 stack<char>s;
		 string str;
		 cin>>str;
         int i=0;
		 for(i=0;i!=str.length();i++)
		 {
			 char ch=str[i];
			 if(ch==')')
			 {
				 if(s.top()=='(')
				 {
					 cout<<"Duplicate\n";
                     break;//added
					// return 0; this will stop execution of program which we dont want becuase we have other test case as well
				 }
			   else
			      {
					 while(s.top()!='(')
					 {
						 s.pop();
					 }
					 s.pop();// u commented this
				 }
			 }
			 else
			 {
			     s.push(ch);
			 }
	    }
        if(i==str.size())
	    cout<<"Not Duplicates\n";
    }
}