Added 25 solutions

This commit is contained in:
rshaghoulian
2017-02-24 00:24:47 -06:00
parent 05ce4b1476
commit af8c2969a4
50 changed files with 1562 additions and 277 deletions
@@ -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");