Refactored all solutions

This commit is contained in:
rshaghoulian
2017-04-05 18:42:35 -05:00
parent 5f4c2f4a78
commit decc8e791e
135 changed files with 848 additions and 849 deletions
@@ -6,14 +6,12 @@ import java.util.Scanner;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
/* If a PatternSyntaxException is not thrown by Pattern.compile,
then the regular expression is valid.
*/
// If a PatternSyntaxException is not thrown by Pattern.compile, the regular expresion is valid
public class Solution {
public static void main(String[] args){
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int testCases = Integer.parseInt(scan.nextLine());
while (testCases-- > 0){
while (testCases-- > 0) {
String pattern = scan.nextLine();
try {
Pattern.compile(pattern);