HackerEarth Pebbles Game problem solution - TheCScience