Redundant Parentheses

import java.util.*;
public class Main {
public static boolean check(String s){
Stack st=new Stack<>();
char[] str=s.toCharArray();
for(char ch:str){
if(ch==’)’){
char top=st.peek();
st.pop();
boolean flag=true;
while(top!=’(’){

				if(top=='+' || top=='-'||top=='/'||top=='*')
				   flag=true;
				 top=st.peek();
				 st.pop();  
			}
			if(flag==true)
			return true;}
			else{
				st.push(ch);}
			
		

	}return false;	}
	public static void find(String stri){
		boolean ans=check(stri);
		if(ans==true){
		System.out.println("Yes");
	}
	else
	System.out.println("No");}

public static void main(String args[]) {
	try{
		Scanner sc=new Scanner(System.in);
		String d=sc.nextLine();
		find(d);
	
	}
	catch(Exception e){System.out.println(e);}

}

}
What is wrong with the code

@Sweta,
Here is your corrected code: https://ide.geeksforgeeks.org/C7qwCyOB2j
There were minor errors and you had to take n inputs instead of 1 input.