ZS Associates interview question

Write a function to calculate mse and mae.