Please check my code

//I am getting WA , please check
public static boolean redundant(String str){
Stack s=new Stack<>();
int count=0;
for(int i=0;i<str.length();i++){
char ch=str.charAt(i);
if(ch==’)’&&!s.isEmpty()){
count=0;
while(s.peek()!=’(’){
count++;
s.pop();
}
s.pop();
if(count<1){
return true;
}

		}
		else{
			s.push(ch);
		}
	}
	return false;

}

hey @Vipin_coder
just a smal mistake, its "Not Duplicates "
correct this

Please mark your doubt as resolved and rate as well :slight_smile: