Skip to main content
100%

Sudoku solver

✓ Published0🌍 Public
VValIlya
Last edited Jun 26, 2022
Created on Jun 26, 2022

This example shows a Python implementation of a Sudoku solver that finds a complete solution for a given 9x9 puzzle. The code defines a `Solution` class with a recursive backtracking algorithm in `solve_step`, which selects the cell with the fewest possible candidates and tries each valid number until the board is filled. It uses a `get_possible_numbers` method to compute remaining digits by checking row, column, and 3x3 square constraints. The solver modifies the board in place and is verified against an expected solution using test functions.

AI-generated description

Similar vizzes