Skip to content

Commit 3e00766

Browse files
pedram-mohajercclauss
authored andcommitted
Add doctest to is_safe function (TheAlgorithms#11183)
1 parent 12d2660 commit 3e00766

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
@@ -24,6 +24,10 @@ def is_safe(board: list[list[int]], row: int, column: int) -> bool:
2424
Returns:
2525
Boolean Value
2626
27+
>>> is_safe([[0, 0, 0], [0, 0, 0], [0, 0, 0]], 1, 1)
28+
True
29+
>>> is_safe([[1, 0, 0], [0, 0, 0], [0, 0, 0]], 1, 1)
30+
False
2731
"""
2832

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

0 commit comments

Comments
 (0)