Add a Sudoku solver using backtracking to scripts/.
Why
scripts/ has linear search, binary search, merge sort, and Tower of Hanoi. Backtracking is the missing algorithm family, and Sudoku is the friendliest example of it — the recursion is visible in the grid.
Suggested file
scripts/sudoku_solver.py
What it should do
- Hold a 9×9 puzzle as a list of lists,
0 for blanks.
- Solve it in place: find the next empty cell, try 1–9, recurse, undo on failure.
- Print the grid before and after, in 3×3 blocks.
Acceptance criteria
Inspiration
sudoku-solver from Awesome-Python-Scripts.
Good first issue for anyone comfortable with recursion — comment below to get assigned.
Add a Sudoku solver using backtracking to
scripts/.Why
scripts/has linear search, binary search, merge sort, and Tower of Hanoi. Backtracking is the missing algorithm family, and Sudoku is the friendliest example of it — the recursion is visible in the grid.Suggested file
scripts/sudoku_solver.pyWhat it should do
0for blanks.Acceptance criteria
grid[r][c] = 0) — not a brute-force permutation generator.is_valid(grid, row, col, value)checks row, column, and the 3×3 box.Falsefor an unsolvable puzzle instead of hanging or crashing.assert-based self-check on one known puzzle with a known solution.Inspiration
sudoku-solver from Awesome-Python-Scripts.
Good first issue for anyone comfortable with recursion — comment below to get assigned.