You are viewing a single comment's thread. Return to all comments →
public class Solution { public static void main(String[] args){
Scanner in = new Scanner(System.in); int testCases = Integer.parseInt(in.nextLine()); while(testCases-->0){ try { Pattern.compile(in.nextLine()); System.out.println("Valid"); } catch (PatternSyntaxException e) { System.out.println("Invalid"); } } in.close(); }
}
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Pattern Syntax Checker
You are viewing a single comment's thread. Return to all comments →
public class Solution { public static void main(String[] args){
}