JAVA
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Created by Aditya
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int h = sc.nextInt();
sc.nextLine();
int n;
String s1;
for (int k = 0; k<h; k++){
s1 = sc.nextLine();
n = Code.display(s1);
if(n==1){
System.out.println("Yes");
}else{
System.out.println("No");
}
}
}
}
class Code {
public static int display(String password){
if(password.matches("^(?![0-9]).*[0-9]{1,}.*(?![0-9]).$") &&
password.matches("^(?![@#?%&]).*[@#?%&]{1,}.*(?![@#?%&])$") &&
password.matches("^(?![A-Z]).*[A-Z]{1,}.*(?![A-Z]).$") &&
password.length()>=10 )
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run