Watch backtracking place and retract queens on an N×N board — a flat 2D chessboard, the classic representation of the puzzle.
The algorithm places queens column by column. For each column it tries every row from top to bottom. If a placement conflicts (same row, or same diagonal as any earlier queen), it backtracks immediately. When all N columns have a queen without conflict, a solution is recorded.