N Queens Problem in Java using Backtracking
N Queen problem is of placing N queens on an N×N chessboard so that no two queens attack each other.
Let us first understand what we want to achieve? what is the input and what is the expected output?
You are given a chess board of N * N size, you have to place N Queens on a chess board in such a way that no queens are attacking each other.
Note: Queens attacks on same row, on same column as well as diagonally.
Sample Input and output for 4 * 4 chess board





