Prints the boards that have a successful combination.
(board: list[list[int]])
| 90 | |
| 91 | |
| 92 | def printboard(board: list[list[int]]) -> None: |
| 93 | """ |
| 94 | Prints the boards that have a successful combination. |
| 95 | """ |
| 96 | for i in range(len(board)): |
| 97 | for j in range(len(board)): |
| 98 | if board[i][j] == 1: |
| 99 | print("Q", end=" ") # Queen is present |
| 100 | else: |
| 101 | print(".", end=" ") # Empty cell |
| 102 | print() |
| 103 | |
| 104 | |
| 105 | # Number of queens (e.g., n=8 for an 8x8 board) |