HackerEarth Coprimes problem solution - TheCScience