#51

N-Queens

hard· Backtrackingruns: 0

The n-queens puzzle places n queens on an n x n chessboard such that no two queens attack each other. Given an integer n, return all distinct solutions to the n-queens puzzle. Each solution contains a board configuration where 'Q' marks a queen and '.' marks an empty square.

sign in to paste and practice your own solution
desktop only

codedrill is a typing game and needs a real keyboard. open this on a laptop or desktop to practice.

you can still browse problems and sections from your phone.