Practice
/

N-Queens II

N-Queens II

Given an integer n, return the number of distinct solutions to the n-queens puzzle, where n queens are placed on an n x n chessboard so that no two queens attack each other.

Premium Content

Create a free account, then unlock this problem and the entire premium catalog with a one-time CodeSnatch Premium purchase.

Already have an account with premium access? Sign in to continue.