Best Fit Line
Return [slope, intercept] of the least squares line through the points (xs[i], ys[i]).
Example 1
xs [0,1,2]
ys [1,3,5]
returns [2.0,1.0]
The points lie exactly on y = 2x + 1.
Constraints
2 <= len(xs) <= 50- The xs are not all equal
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.