HackerEarth Discover the Monk problem solution - TheCScience