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).
Concept used : Recursion & Backtracking
Language used : cpp