Determinant problem

Problem: Given a square, $$m \times m$$ matrix $$M$$ whose diagonal elements are each equal to $$m$$ and whose non-diagonal elements are each equal to $$-1$$, calculate its determinant.

In symbols,
 * $$\Delta = \begin{vmatrix}m & -1 & -1 & \dots & -1 \\

-1 & m & -1 & \dots & -1 \\ -1 & -1 & m & \dots & -1 \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ -1 & -1 & -1 & \dots & m \end{vmatrix}$$ What is $$\Delta$$ as a function of $$m$$?

Solution.