HackerEarth The String Monster problem solution - TheCScience