We exploit the fact that adding linear combinations of rows to another row does not change the value of the determinant to zero out all elements except the diagonal, subdiagonal and the top right corner and then we compute $\det A$ from Laplace expansion.
First, subtract $k$th row from $(k+1)$th row for $k = 1, \dots, n-1$ to obtain
$$B =\begin{pmatrix}
n & 1 & 1 & \dots & 1 & 1\\
-1 & n-1 & 0 & \dots & 0 & 0\\
-1 & -1 & n-1 & \dots & 0 & 0\\
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots\\
-1 & -1 & -1 & \dots & n-1 & 0\\
-1 & -1 & -1 & \dots & -1 & n-1
\end{pmatrix}.$$
Next, add the bottom row to the top row to get
$$C=\begin{pmatrix}
n-1 & 0 & 0 & \dots & 0 & n\\
-1 & n-1 & 0 & \dots & 0 & 0\\
-1 & -1 & n-1 & \dots & 0 & 0\\
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots\\
-1 & -1 & -1 & \dots & n-1 & 0\\
-1 & -1 & -1 & \dots & -1 & n-1
\end{pmatrix}.$$
Subtract $k$th row from $(k+1)$th row for $k = 2, \dots, n-1$ to obtain
$$D=\begin{pmatrix}
n-1 & 0 & 0 & \dots & 0 & n\\
-1 & n-1 & 0 & \dots & 0 & 0\\
0 & -n & n-1 & \dots & 0 & 0\\
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots\\
0 & 0 & 0 & \dots & n-1 & 0\\
0 & 0 & 0 & \dots & -n & n-1
\end{pmatrix}.$$
Finally, compute determinant of $D$ using Laplace expansion along the top row
$$
\det A = \det D = (-1)^{1+1} (n-1) \det D_{1,1} + (-1)^{n+1} n \det D_{1,n}
$$
where $D_{i,j}$ denotes the matrix obtained from $D$ by deleting the $i$th row and the $j$th column. Both $\det D_{1,1}$ and $\det D_{1,n}$ can now be easily computed by exploiting the fact that determinant of a triangular matrix is the product of the elements on its diagonal
$$
\det A = (n-1) (n-1)^{n-1} + (-1)^{n+1} n (-1) (-n)^{n-2} = (n-1)^n + n^{n-1}
$$
as claimed.