harsh-dart / HactoberFest2024

15 stars 173 forks source link

N-Queen #17

Open Mayank8881 opened 2 months ago

Mayank8881 commented 2 months ago

I would like to contribute to this repository by implementing the N-Queen problem in Python as part of Hacktoberfest 2024.

Description:

The N-Queen problem is a classic backtracking algorithm problem where the goal is to place N queens on an N x N chessboard in such a way that no two queens threaten each other. We need a Python solution for this problem, which includes:

  1. Input:

    • A single integer N, the number of queens and the dimensions of the chessboard (N x N).
  2. Constraints:

    • 1 <= N <= 10
    • Queens cannot be placed in the same row, column, or diagonal.
  3. Output:

    • Return all possible distinct solutions. Each solution contains a distinct board configuration where Q represents a queen, and . represents an empty space.
    • If no solution exists, return an empty list.
  4. Test Cases:

    Example 1:

    Input: N = 4
    Output: [
     [".Q..", 
      "...Q", 
      "Q...", 
      "..Q."],
    
     ["..Q.", 
      "Q...", 
      "...Q", 
      ".Q.."]
    ]

    Example 2:

    Input: N = 1
    Output: [["Q"]]

    Example 3:

    Input: N = 3
    Output: []

Request: Kindly assign this issue to me and add the Hacktoberfest label as I would like to contribute as part of Hacktoberfest 2024. Thank you!


Let me know if you'd like to make any adjustments!

dayam8696 commented 1 month ago

Hi @harsh-dart please assign this to me

shrutipuskar commented 1 month ago

plz assign this task to me and also add hactoberfest tag........

aryaman0406 commented 1 month ago

Hi @harsh-dart please assign me this task.

Blacksujit commented 1 month ago

/assign

Blacksujit commented 1 month ago

PR to this issue --> #111

Smriti-Prajapati commented 1 month ago

Hey please assign this issue to me for Hactoberfest 2024.