update dp method for MinCoins