Added 25 solutions
This commit is contained in:
@@ -12,15 +12,14 @@ public class Solution {
|
||||
public static void main(String[] args){
|
||||
Scanner in = new Scanner(System.in);
|
||||
int testCases = Integer.parseInt(in.nextLine());
|
||||
while(testCases>0){
|
||||
while (testCases > 0) {
|
||||
String username = in.nextLine();
|
||||
//String pattern = Complete this line in the editable area below
|
||||
String pattern = "^[a-zA-Z]\\w{7,29}$";
|
||||
|
||||
Pattern r = Pattern.compile(pattern);
|
||||
Matcher m = r.matcher(username);
|
||||
|
||||
if (m.find( )) {
|
||||
if (m.find()) {
|
||||
System.out.println("Valid");
|
||||
} else {
|
||||
System.out.println("Invalid");
|
||||
|
||||
Reference in New Issue
Block a user