Skip to content

Commit bb3b48f

Browse files
Update n_queens.py
1 parent 30a844a commit bb3b48f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

backtracking/n_queens.py

+4
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@ def is_safe(board: list[list[int]], row: int, column: int) -> bool:
2727
2828
>>> is_safe([[0, 0, 0], [0, 0, 0], [0, 0, 0]], 1, 1)
2929
True
30+
>>> is_safe([[0, 1, 0], [0, 0, 0], [0, 0, 0]], 1, 1)
31+
False
3032
>>> is_safe([[1, 0, 0], [0, 0, 0], [0, 0, 0]], 1, 1)
3133
False
34+
>>> is_safe([[0, 0, 1], [0, 0, 0], [0, 0, 0]], 1, 1)
35+
False
3236
"""
3337

3438
n = len(board) # Size of the board

0 commit comments

Comments
 (0)