arin2002 / Hacktoberfest-2022

For hacktoberfest do fork and star the repo to participate otherwise you won't be able to participate.......You can follow me for more updates :)
MIT License
103 stars 317 forks source link

Create NQueenProb.cpp #960

Closed shxxxam closed 10 months ago

shxxxam commented 10 months ago

What is NQueen Problem? The N Queen is the problem of placing N chess queens on an N×N chessboard so that no two queens attack each other.

WHAT THIS CODE DOES :- Take as input N, the size of a chess board. We are asked to place N number of queens in it, so that no queen can kill other. a. Write a recursive function which returns the count of different distinct ways the queens can be placed across the board. Print the value returned. b. Write a recursive function which prints all valid configurations (void is the return type for function).