We have matrix $A\in M_{n-1\times n}(\mathbb Z)$ so that the sum of entries in each row is zero. Prove that $\det(AA^T)=nk^2.$

Let $A = (B,\mathbf{b})$, where $B \in M_{n-1\times n-1}(\mathbb{Z})$ is a "left square part" of matrix $A$, i.e. $B_i^j = A_i^j$, and $\mathbf{b} \in \mathbb{Z}^{n-1}$ is a "right" part of $A$, i.e. $b_i = A_i^n$. As sum of each row is zero, we have $b_i = -\sum_{k=1}^{n-1}B_i^k$. Let $\mathbf{e}\in \mathbb{Z}^{n-1}$ be a vector with each union component, i.e. $e_i = 1$. Then $\mathbf{b} = -B\mathbf{e}$. Now we may multiply $A$ with $A^{\top}$ as block matrices: $$ AA^{\top} = (B\;\;-B\mathbf{e}) \begin{pmatrix} B^\top \\ -\mathbf{e}^\top B^\top \end{pmatrix} = BB^\top + B\mathbf{e}\mathbf{e}^\top B^\top = B(I + \mathbf{e}\mathbf{e}^\top)B^\top $$ where $I$ is identity matrix. As bouth $B$ and $I + \mathbf{e}\mathbf{e}^\top$ are square matrices we now have $$ \det(AA^\top) = \det\left(B(I + \mathbf{e}\mathbf{e}^\top)B^\top\right) = \det (B) \det(I + \mathbf{e}\mathbf{e}^\top)\det(B^\top) = \det(I + \mathbf{e}\mathbf{e}^\top)\left(\det B\right)^2. $$

$B \in M_{n-1\times n-1}(\mathbb{Z})$ thus $\det B \in \mathbb{Z}$.

Now all we need to proof is that $\det(I + \mathbf{e}\mathbf{e}^\top) = n$. This matrix (denote it with $E_{n-1}$ where $n-1$ is dimension of the space or count of raws in $E$) looks like $$ E_{n-1} = \begin{pmatrix} 2 & 1 & \dots & 1 \\ 1 & 2 & \dots & 1\\ \vdots & \vdots & \ddots & \vdots \\ 1 & 1 & \dots & 2 \end{pmatrix}. $$

Let $E^i_n$ be a matrix $E_n$ in which we replaced $2$ in $i$-th row with $1$. It's easy to see that $\det{E^1_n} = 1$ (using Gaussian process). Thus if $i$ is even $\det E_n^i = 1$ and if i is odd $\det E^i_n = -1$, i.e. $\det E^i_n = (-1)^i$. Now let's suppose we know that $\det E_{n-1} = n$. We may decompose $\det E_n$ using Laplace expansion: $$ \det E_n = 2\det E_{n-1} + \sum_{i=1}^{n-1} (-1)^{i}\det E^i_{n-1} = 2n - (n-1) = n+1. $$ QED.