Practice
/

N-Queens

N-Queens

Place n queens on an n x n chessboard so that no two queens attack each other. Return all distinct board configurations as lists of strings, where 'Q' represents a queen and '.' represents an empty space.

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.