HackerEarth The Old Monk problem solution - TheCScience