HackerEarth An interesting game problem solution - TheCScience