exchanging the coordinates x with y of both knight and target will result in same ans .
dp [ Math . abs ( y - ty ) ] [ Math . abs ( x - tx ) ] = dp [ Math . abs ( x - tx ) ] [ Math . abs ( y - ty ) ] ; return dp [ Math . abs ( x - tx ) ] [ Math . abs ( y - ty ) ] ; } }