β Digits Rearrangement (Contest)
Digits Rearrangement (Contest) easy Time Limit: 2 sec Memory Limit: 128000 kB
```java
import java.io.*; // for handling input/output
import java.util.*; // contains Collections framework
// don't change the name of this class
// you can add inner classes if needed
class Main {
public static void main (String[] args) {
// Your code here
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
for(int ti=0; ti<t; ti++){
int n = sc.nextInt();
sc.nextLine();
String str = sc.nextLine();
boolean Divisible = false;
for(int i=0; i<n; i++){
char character = str.charAt(i);
if(character == '0' || character == '5'){
Divisible = true;
break;
}
}
if(Divisible){
System.out.println("Yes");
}
else{
System.out.println("No");
}
}
}
}
```Last updated