| 111 | } |
| 112 | |
| 113 | int main() |
| 114 | { |
| 115 | |
| 116 | int n = 0; |
| 117 | // Input Size of the chessboard |
| 118 | // No of queens will be the same as size n. |
| 119 | std::cin >> n; |
| 120 | if (n <= 3) |
| 121 | { |
| 122 | std::cout << "No solution exists for n = " << n << std::endl; |
| 123 | } |
| 124 | // 2D vector for storing board having size max size of nXn. |
| 125 | // First create a column vector of size n. |
| 126 | std::vector<int> column(n); |
| 127 | // Create Row vectors and fill rows with columns. |
| 128 | std::vector<std::vector<int>> board(n, column); |
| 129 | |
| 130 | // Function call for |
| 131 | // Arguments passed are : 2D vector board |
| 132 | // : No of queens |
| 133 | // : Starting row. |
| 134 | N_Queens(board, n, 0); |
| 135 | |
| 136 | return 0; |
| 137 | } |
nothing calls this directly
no test coverage detected