The Wayback Machine - https://web.archive.org/web/20250114225934/https://www.geeksforgeeks.org/videos/sde-sheet-n-queen-problem/
  • Courses
  • Tutorials
  • DSA
  • Data Science
  • Web Tech
January 03, 2024 |450 Views

SDE Sheet - N-Queen Problem

Description
Discussion

This video is part of the Backtracking section under the GFG SDE Sheet.

In this problem, we are given The n-queens puzzle is the problem of placing n queens on a (n×n) chessboard such that no two queens can attack each other.
Given an integer n, find all distinct solutions to the n-queens puzzle. Each solution contains distinct board configurations of the queen placement, where the solutions are a permutation of [1,2,3..n] in increasing order, here the number in the ith place denotes that the ith-column queen is placed in the row with that number

Try it out before watching the implementation of the problem in the video. We recommend watching the video, even if you can solve the problem. You may discover something new. All the best!!!

Do check out:-
Article: https://www.geeksforgeeks.org/printing-solutions-n-queen-problem/
Problem: https://www.geeksforgeeks.org/problems/n-queen-problem0315/1
SDE Sheet Link: https://www.geeksforgeeks.org/sde-sheet-a-complete-guide-for-sde-preparation/