Mean absolute and squared error

Write codeEasy15 minMeta style

Your task

Given y_true and y_pred (equal-length non-empty lists of numbers), compute the mean absolute error (MAE = mean of |y_true - y_pred|) and the root mean squared error (RMSE = sqrt of the mean of (y_true - y_pred)^2). Return [mae, rmse], each rounded to 6 decimals.

Examples

mae_rmse(y_true: list[float], y_pred: list[float]) -> list[float]
Example 1
Inputmae_rmse([1, 2, 3], [1, 2, 3])
Output[0, 0]