The logic behind the solution approach and any other way to do this


#1

Can someone please explain the logic behind the solution approach?


#2

Hi, In this problem, there is Max function given.And this Max function should give Min solution . So for this Max function parameters here it is (abs (a-b)). it means Diff. So Diff should be minimum. To do so when need to Increase one of the variable. so that Diff must be small. So that Max function return will be small.