How many ways are there of filling an $n×n$ square grid with $0$s and $1$s if you are allowed at most two $1$s in each row and two $1$s in each column?
I need some ideas for solving this problem.
PS:This problem is from the book Princeton Companion Mathematics.