HackerEarth Gold Coins Solved