Euclidean and Manhattan distance
Your task
Given two equal-length numeric vectors, return both their Euclidean (L2) distance and their Manhattan (L1) distance as a two-element list [euclidean, manhattan]. Euclidean distance is the square root of the sum of squared differences; Manhattan distance is the sum of absolute differences. Inputs are non-empty lists of the same length. Round each distance to 4 decimal places.
Examples
distances(a: list[float], b: list[float]) -> list[float]Example 1
Input
distances([0, 0], [3, 4])Output
[5, 7]