Find all matrices in $\{\pm1\}^{n \times n}$ such that the sums of its rows and columns are zero 
Find all matrices in $\{\pm1\}^{n \times n}$ such that the sums of its rows and columns are zero.

The question was for $n = 4$, which was easy to do with counting. For any $n$ how would we do it?
 A: Note that $n$ must be even. Thus, $m := \frac n2$ is an integer. Each row and column must have $m$ plus ones and $m$ minus ones. Applying $x \mapsto \frac{x+1}{2}$ to each entry, we then have $m$ ones and $m$ zeros in each row and column. Thus, we want to find all matrices in the following set
$$\{ \mathrm X \in \{0,1\}^{n \times n} \mid \mathrm X 1_n = m 1_n \,\land\,  \mathrm 1_n^{\top} \mathrm X = m \mathrm 1_n^{\top} \}$$
Vectorizing, $\tilde{\mathrm x} := \mbox{vec} (\mathrm X)$, we obtain
$$\bigg\{ \tilde{\mathrm x} \in \{0,1\}^{n^2} : \begin{bmatrix} 1_n^{\top} \otimes \mathrm I_n\\ \mathrm I_n \otimes \mathrm 1_n^{\top}\end{bmatrix} \tilde{\mathrm x} = m \begin{bmatrix} \mathrm 1_n\\ \mathrm 1_n\end{bmatrix} \bigg\}$$
or,
$$\bigg\{ \tilde{\mathrm x} \in [0,1]^{n^2} : \begin{bmatrix} 1_n^{\top} \otimes \mathrm I_n\\ \mathrm I_n \otimes \mathrm 1_n^{\top}\end{bmatrix} \tilde{\mathrm x} = m \begin{bmatrix} \mathrm 1_n\\ \mathrm 1_n\end{bmatrix} \bigg\} \cap \mathbb Z^{n^2}$$
Thus, we want to enumerate all integer points inside a convex polytope [0], or, in other words, to enumerate all solutions to a binary linear program. Applying $x \mapsto 2 x - 1$ to each entry of each admissible matrix, we obtain the desired $\pm 1$ matrices.

[0] Alexander Barvinok, James Pommersheim, An Algorithmic Theory of Lattice Points in Polyhedra, New Perspectives in Geometric Combinatorics, MSRI Publications, Vol. 38, 1999.
