Chebyshev Distance
EasyMachine LearningMath
Description
Given two equal-length vectors, return the Chebyshev distance between them: the maximum absolute difference across all coordinates.
Examples
Input:
[1,2,3], [4,2,1]Output:
3Explanation:
Chebyshev measures separation by the single coordinate where the two vectors differ most.
Input:
[0,0], [3,4]Output:
4Explanation:
Chebyshev measures separation by the single coordinate where the two vectors differ most.
Input:
[1,1], [1,1]Output:
0Explanation:
Chebyshev measures separation by the single coordinate where the two vectors differ most.
Constraints
- •
1 ≤ length ≤ 10⁴