HackerRank Java Regex 2 - Duplicate Words problem solution - TheCScience