Skip to content

Latest commit

 

History

History
26 lines (23 loc) · 509 Bytes

README.md

File metadata and controls

26 lines (23 loc) · 509 Bytes

N Queens Problem

N - Queens problem is to place n queens in such a manner on an n x n chessboard that no queens attack each other by being in the same row, column or diagonal.

How to run

$ python3 main.py <board-size>

Example

$ python3 main.py 3
  No solution found

$ python3 main.py 4
  -----------------
  |   | 1 |   |   |
  -----------------
  |   |   |   | 1 |
  -----------------
  | 1 |   |   |   |
  -----------------
  |   |   | 1 |   |
  -----------------