SidJain1412 / CompetitiveProgramming

:question: Tracking progress completing good programs, training for placements. (Contri.s welcomed)
23 stars 34 forks source link

Add NQueens #85

Closed prasathk11 closed 3 years ago

prasathk11 commented 3 years ago

Problem Name: NQueens

Problem Description: The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integer n, return all distinct solutions to the n-queens puzzle. Each solution contains a distinct board configuration of the n-queens' placement, where 'Q' and '.' both indicate a queen and an empty space respectively. There exist two distinct solutions to the 4-queens puzzle as shown above.

INPUT: 4

OUTPUT: [ #Solution1 [".Q..",
"...Q", "Q...", "..Q."],

CONSTRAINTS:

Sample input: 4

Sample output: ["..Q.",
"Q...", #solution2 "...Q", ".Q.."] ]

prasathk11 commented 3 years ago

could please assign this issue to me I solved this NQueen problem.