Churn prediction MAE

Write codeEasy10 minMeta style

Your task

A churn model predicts, for each at-risk subscriber, how many days until they cancel. The retention dashboard reports the model's average miss in whole days. Given non-empty equal-length lists y_true and y_pred of integer day counts, compute the sum of absolute differences |y_true[i] - y_pred[i]|, divide by the number of subscribers, and return the result rounded down to an integer. Example: y_true = [10, 20, 30], y_pred = [12, 18, 33] has absolute misses 2, 2, 3 summing to 7, so return floor(7 / 3) = 2.

Examples

avg_miss_days(y_true: list[int], y_pred: list[int]) -> int
Example 1
Inputavg_miss_days([10, 20, 30], [12, 18, 33])
Output2