Skip to content

Commit 30a844a

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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backtracking/n_queens.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def is_safe(board: list[list[int]], row: int, column: int) -> bool:
3434
n = len(board) # Size of the board
3535

3636
# Check if there is any queen in the same upper column,
37-
# left upper diagonal and left lower diagonal
37+
# left upper diagonal and right upper diagonal
3838
return (
3939
all(board[i][j] != 1 for i, j in zip(range(row), [column] * row))
4040
and all(

0 commit comments

Comments
 (0)