SidJain1412 / CompetitiveProgramming

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

Added NQueens in Backtracking folder #87

Closed prasathk11 closed 3 years ago

prasathk11 commented 3 years ago

Issue : #85 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.."] ]

SidJain1412 commented 3 years ago

Hey @Starkultra could you please add these details (problem, sample I/O, etc.) within the code as comments, like in other programs in the repository?

prasathk11 commented 3 years ago

Hey @SidJain1412 added ques, i/p, and o/p as a comment please check it now

SidJain1412 commented 3 years ago

@all-contributors please add @Starkultra for code

allcontributors[bot] commented 3 years ago

@SidJain1412

I've put up a pull request to add @Starkultra! :tada:

SidJain1412 commented 3 years ago

Thanks for contributing @Starkultra 😄