Can any body tell which test case it will fail in PASSWD PROBLEM

/* package codechef; // don’t place package name! */

import java.util.;
import java.lang.
;
import java.io.*;

/* Name of the class has to be “Main” only if the class is public. */
class Codechef
{
public static boolean checkpass(String data){
boolean correct=false,c3=false,c4=false,c5=false;

   char []a=data.toCharArray();
   int n1=data.length();
   if(n1>=10){
   if((int)a[0]>=97 && (int)a[0]<=122){
   if((int)a[n1-1]>=97 && (int)a[n1-1]<=122){
       for(int i=1;i<n1-1;i++){
         if((int)a[i]>=48&&(int)a[i]<=57)c3=true;
         if((int)a[i]==64||(int)a[i]==35||(int)a[i]==37||(int)a[i]==38||(int)a[i]==63)c4=true;
         if((int)a[i]>=65&&(int)a[i]<=90)c5=true;
       } 
    }
    }
}
   

  
  correct=c3&&c4&&c5;
  return correct;

}
public static void main (String[] args)
{ try {

	Scanner sc=new Scanner(System.in);
	int n=sc.nextInt();
	String data;
	for(int i=0;i<n;i++){
	  data=sc.next(); 
	 if( checkpass(data))System.out.println("YES");
	 else System.out.println("NO");
	}
} catch(Exception e) { return;
} 
}

}

Bro you are not missing a test case, you are actually interpreting the question wrongly.

If you look closely you would find that atleast one element inside the array should be digit or upper case, this means that the first and the last character can be anything! , that is accepatable ofcourse.
I kept on making the same mistake as you are making.
Just check if the conditions are met, that’s it. if you still don’t get it, look at the AC submissions you will get it.

PS: if you are planning to use Java, it would be better to use faster input/ouput methods.

1 Like

thanks