Skip to content

Commit 42ee723

Browse files
committed
refactor: update variable names
1 parent 2da5ae1 commit 42ee723

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

project_euler/problem_096/sol1.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ def solve(
6565
col: list[int],
6666
box: list[int],
6767
board: list[list[str]],
68-
i: int,
69-
n: int,
68+
index: int,
69+
total: int,
7070
) -> bool:
7171
"""
7272
Recursive backtracking function to solve the sudoku
@@ -92,11 +92,11 @@ def solve(
9292
... 1)
9393
True
9494
"""
95-
if i == n:
95+
if index == total:
9696
return True
9797

9898
# Get the row and column numbers for the current unfilled cell
99-
r, c = unfilled[i]
99+
r, c = unfilled[index]
100100

101101
for val in range(9):
102102
# Check if value (val+1) can be placed at position (r, c)
@@ -112,7 +112,7 @@ def solve(
112112
board[r][c] = str(val + 1)
113113

114114
# Recursively solve
115-
if solve(unfilled, row, col, box, board, i + 1, n):
115+
if solve(unfilled, row, col, box, board, index + 1, total):
116116
return True
117117

118118
# Backtrack

0 commit comments

Comments
 (0)