This problem comes from cracking the coding interview chapter 7 problem 6. To me as a mathematician this seems like a simple least squares problem where we find the best fit line. Although, in the solution they take a different approach.
My question is the following: is a developing a least squares approach a sufficient solution or am I not understanding the problem at hand?