ans will be , 1 + minimum of steps required from ( x1 , y1 ) and ( x2 , y2 ) .
dp [ Math . Abs ( x - tx ) , Math . Abs ( y - ty ) ] = Math . Min ( getsteps ( x1 , y1 , tx , ty ) , getsteps ( x2 , y2 , tx , ty ) ) + 1 ;