Skip to content

Commit b3a9693

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent d0986a4 commit b3a9693

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

backtracking/n_queens.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ def is_safe(board: list[list[int]], row: int, column: int) -> bool:
3838
return (
3939
all(board[i][j] != 1 for i, j in zip(range(row), [column] * row))
4040
and all(
41-
board[i][j] != 1 for i, j in zip(range(row - 1, -1, -1), range(column - 1, -1, -1))
41+
board[i][j] != 1
42+
for i, j in zip(range(row - 1, -1, -1), range(column - 1, -1, -1))
4243
)
4344
and all(
44-
board[i][j] != 1 for i, j in zip(range(row - 1, -1, -1), range(column + 1, n))
45+
board[i][j] != 1
46+
for i, j in zip(range(row - 1, -1, -1), range(column + 1, n))
4547
)
4648
)
4749

0 commit comments

Comments
 (0)