[Q4.9]calculate cost of flipping one number to the other