Skip to content

Commit a9eb6de

Browse files
Update n_queens_math.py
1 parent 040437a commit a9eb6de

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

backtracking/n_queens_math.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,12 @@ def depth_first_search(
137137

138138
# If it is False we call dfs function again and we update the inputs
139139
# Add new values to the current lists
140-
possible_board.append(col)
141-
diagonal_right_collisions.append(row - col)
142-
diagonal_left_collisions.append(row + col)
140+
possible_board.append(col)
141+
diagonal_right_collisions.append(row - col)
142+
diagonal_left_collisions.append(row + col)
143143

144144
# Recursive call with updated lists
145-
depth_first_search(possible_board, diagonal_right_collisions, diagonal_left_collisions, boards, n)
145+
depth_first_search(possible_board, diagonal_right_collisions, diagonal_left_collisions, boards, n)
146146

147147
# Backtrack by removing the last added values after returning from recursion
148148
possible_board.pop()

0 commit comments

Comments
 (0)