Implement `totalNQueens(n)` returning the number of distinct ways to place `n` queens on an `n × n` board so that no two attack each other (no shared row, column, or diagonal).
+ 2 hidden tests run on Submit.
Each row gets exactly one queen, so the search tries every safe column per row. Three sets give O(1) attack checks for columns and the two diagonal directions, and removing the marks on the way back out restores state for sibling branches. Counting completed placements yields the total.
Run your code to see results.