QR factorisation and least squares
To solve a least squares problem, let $A=QR$ be the QR factorisation of $A$, and assume $A$ has full rank $n$.
Since orthogonal transformations are length-preserving, $$ \begin{align*} \|A\v c - \v y\| = \|Q^T(A\v c - \v y)\| = \|R\v c - Q^T \v y\| \end{align*} $$ Let $Q^T \v y = \v z$. The form of $R\v c - Q^T \v y$ looks like $$ \begin{align*} \pmat{* & * & \ldots & * \\ &* & \ldots & * \\ &&\ddots & \vdots \\ &&&* \\ 0 & 0 & \ldots & 0 \\ \vdots & \vdots & & \vdots \\ 0 & 0 & \ldots & 0} \pmat{c_1 \\ c_2 \\ \vdots \\ c_n} - \pmat{z_1 \\ z_2 \\ \vdots \\ z_{n} \\ z_{n+1} \\ \vdots \\ z_{m}}. \end{align*} $$ We see that the best $\v c$ we can pick is by solving the non-singular linear system corresponding to the first $n$ equations (using back substitution).