Euclidean Distance
EasyMachine LearningMathTree
Description
Given two equal-length points a and b, return the Euclidean (L2) distance between them, rounded to 4 decimal places.
Examples
Input:
a = [0,0], b = [3,4]Output:
5Explanation:
Taking the square root of the summed squared differences gives 5.
Input:
a = [1,1], b = [1,1]Output:
0Explanation:
Taking the square root of the summed squared differences gives 0.
Input:
a = [1,2,3], b = [4,5,6]Output:
5.1962Explanation:
Taking the square root of the summed squared differences gives 5.1962.
Constraints
- •
1 ≤ a.length ≤ 10⁴