HackerEarth Roy and Tiles problem solution - TheCScience