Got TLE for n = 9. Locally it takes 1.03 s to run.

```
class Solution:
# @return an integer
def totalNQueens(self, n):
solutions = []
for solution in itertools.permutations(range(n)):
if len(set(x-y for x,y in enumerate(solution))) == \
len(set(x+y for x,y in enumerate(solution))) == n:
solutions.append(solution)
return len(solutions)
```