AI Assignment 4
AI Assignment 4
N-Queen’s Problem
Code:
def print_solution(board):
"""Function to print the chessboard solution."""
for row in board:
print(" ".join("Q" if cell else "_" for cell in row))
print() # Print a newline for better readability
else:
print("Oops! Board size is too large. Please select a smaller value.")
Output: