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

Add N Queens Problem #314

Closed
Ayush-Garg1 opened this issue Oct 5, 2024 · 1 comment
Closed

Add N Queens Problem #314

Ayush-Garg1 opened this issue Oct 5, 2024 · 1 comment

Comments

@Ayush-Garg1
Copy link

Problem Statement: N Queens

Description:
The n-queens puzzle is the problem of placing 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. You may return the answer in any order.
Each solution contains a distinct board configuration of the n-queens' placement, where 'Q' and '.' both indicate a queen and an empty space, respectively.

Input:
An integer n

Output:
A list of all possible placements.

Example:
Input: n = 4
Output: [[".Q..","...Q","Q...","..Q."],["..Q.","Q...","...Q",".Q.."]]
Explanation: There exist two distinct solutions to the 4-queens puzzle as shown above

Constraints:
1 <= n <= 9

PLEASE ASSIGN THIS ISSUE TO ME AS PART OF HACKTOBERFEST 2024.
THANK YOU

Copy link

github-actions bot commented Oct 5, 2024

Thank you for raising a issue, Hope you enjoing the open source. we try to reply or assign as soon possibe. Connect with mentor.

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

No branches or pull requests

1 participant