public class StringPrimary {
public boolean solution(String s) {
if (s.length() == 4 || s.length() == 6) {
for (int i = 0; i < s.length(); i++) {
if ((s.charAt(i) >= 'a' && s.charAt(i) <= 'z')) {
return false;
}
}
} else {
return false;
}
return true;
}
public static void main(String[] args) {
StringPrimary s = new StringPrimary();
System.out.println(s.solution("a234"));
System.out.println(s.solution("1234"));
System.out.println(s.solution("1a34"));
System.out.println(s.solution("d132as"));
System.out.println(s.solution("11331"));
}
}