4. The N-Queens problem:
• Implement a backtracking solution to solve the N-Queens problem.
• Implement a predicate to count the number of solutions to the N-Queens problem.
• Requirements:
o Define n_queens(N, Solution), where Solution is a list of column positions for queens in an N×N board.
o Define n_queens_count(N, Count), where Count is the number of solutions for an N×N board.
• Sample queries:
o ?- n_queens(4, Solution).
Solution = [2, 4, 1, 3];
Solution = [3, 1, 4, 2].
o ?- n_queens_count(4, Count).
Count = 2.
o ?- n_queens_count(8, Count).
Count = 92.