FunctionRacerProblemsRace

Vector Distance

EasyNumPyPython

The Euclidean distance between two arrays of the same length is the square root of the sum of (a[i] - b[i]) ** 2 over all positions. Return it as a float.

Example 1

a [1,2,3]
b [4,6,3]
returns 5.0

The differences are 3, 4 and 0, so sqrt(9 + 16 + 0) = 5.0.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More NumPy problems