Added 20 solutions

This commit is contained in:
rshaghoulian
2017-02-16 23:51:56 -06:00
parent 5ac5cfba70
commit 34e66564f9
26 changed files with 859 additions and 57 deletions
@@ -0,0 +1,31 @@
// Author: Rodney Shaghoulian
// Github: github.com/rshaghoulian
// HackerRank: hackerrank.com/rshaghoulian
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int testCases = Integer.parseInt(in.nextLine());
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( )) {
System.out.println("Valid");
} else {
System.out.println("Invalid");
}
testCases--;
}
}
}