Code RoomMean absolute and squared error
EasyPrep Room Coding #233

Mean absolute and squared error

CodingML systemsMid~15 min

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.

Implement
mae_rmse(y_true: list[float], y_pred: list[float]) → list[float]
Examples
in[[1,2,3],[1,2,3]]out[0,0]
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

0:00 of about 15 min
InputExpectedGot
[[1,2,3],[1,2,3]][0,0]not run yetsample