Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

N-Queen #17

Open
Mayank8881 opened this issue Oct 3, 2024 · 6 comments
Open

N-Queen #17

Mayank8881 opened this issue Oct 3, 2024 · 6 comments
Assignees

Comments

@Mayank8881
Copy link

Mayank8881 commented Oct 3, 2024

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
Copy link

Hi @harsh-dart please assign this to me

@shrutipuskar
Copy link

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

@aryaman0406
Copy link

Hi @harsh-dart please assign me this task.

@Blacksujit
Copy link

/assign

@Blacksujit
Copy link

PR to this issue --> #111

@Smriti-Prajapati
Copy link

Hey please assign this issue to me for Hactoberfest 2024.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants