The N-Queens puzzle places N queens on an N×N chessboard such that no two queens attack each other.
A queen can attack another queen if they share the same row, column, or diagonal.
Given a positive integer n, return the total number of distinct valid arrangements of n queens on an n×n board.
Solution Stats
Solution Comments
Show comments
Loading...
Problem Recent Solvers2
Suggested Problems
-
N-Queens: Count All Valid Arrangements
2 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!