HackerRank Pattern Syntax Checker in java problem solution - TheCScience