PLEASE CHECK MY CODE. THE CODE IS RUNNING FINE ON NETBEANS AND ALSO GIVING CORRECT OUTPUT FOR SAMPLE TEST CASE. BUT ALL THE THREE TEST CASES ARE SHOWING ‘WRONG ANSWER’. I HAVE GONE THROUGH THE HINT VIDEO. THE SAME LOGIC IS EXPLAINED THERE WHICH I HAVE USED. PLEASE HELP ME.
import java.util.*;
public class ExistOrNot
{
public static void main(String[] args)
{
HashMap<Integer,Boolean> map=new HashMap<>();
Scanner sc=new Scanner(System.in);
int T=sc.nextInt();
for(int i=1;i<=T;i++)
{
int j,L=sc.nextInt();
for(j=0;j<L;j++)
{
int num=sc.nextInt();
map.put(num,true);
}
int Q=sc.nextInt();
for(j=1;j<=Q;j++)
{
int N=sc.nextInt();
if(map.containsKey(N))
System.out.println(“Yes”);
else
System.out.println(“No”);
}
}
}
}