size queens on a size × size chessboard so that none of them attacks another: no two queens may share a row, a column or a diagonal.
Return the number of distinct such layouts. Layouts that turn into each other by rotating or mirroring the board count as different.size=5 → 10
A 5×5 board has 10 layouts of five queens in which no queen attacks another.
size=2 → 0
Two queens on a 2×2 board always share a row, a column or a diagonal.
size=1 → 1
size ≤ 9size=5
10
Run checks the first 3 tests in your browser. Submit checks all 12 tests on the server, hidden ones included.