} else if already calculated then return that value . Taking absolute difference .
if ( dp [ Math . abs ( x - tx ) ] [ Math . abs ( y - ty ) ] != 0 ) { return dp [ Math . abs ( x - tx ) ] [ Math . abs ( y - ty ) ] ; } else {