if already calculated then return that value . Taking absolute difference .
elif ( dp [ abs ( x - tx ) ] [ abs ( y - ty ) ] != 0 ) : NEW_LINE INDENT return dp [ abs ( x - tx ) ] [ abs ( y - ty ) ] ; NEW_LINE DEDENT else : NEW_LINE