Sign-up forecast MSE
A growth team's model forecasts daily sign-ups, and the eval report penalizes big misses much more than small ones by using squared error. Given non-empty equal-length integer lists y_true (actual sign-ups) and y_pred (forecasts), compute the sum of (y_true[i] - y_pred[i])^2 over all days, divide by the number of days, and return the result rounded down to an integer. Example: y_true = [100, 200], y_pred = [110, 190] gives (100 + 100) / 2 = 100.
Implement
squared_error_floor(y_true: list[int], y_pred: list[int]) → intExamples
in
[[100,200],[110,190]]out100What 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 10 min
solution.py
InputExpectedGot
[[100,200],[110,190]]100not run yetsample