/Sudoku

Sudoku solver in Python

Primary LanguagePython

Sudoku

Sudoku is a famous number puzzle game. A sudoku puzzle is a grid of 9x9 squares or cells, that has been subdivided into nine subgrids of 3x3 cells. The aim is for these squares and grids to all contain a number from 1 to 9 using logic to determine which number fits into a specific cell.

Backtracking Algorithm

Have used the Backtracking approach to solve the Sudoku puzzle.A backtracking algorithm is a problem-solving algorithm that uses a brute force approach for finding the desired output.

The term backtracking suggests that if the current solution is not suitable, then backtrack and try other solutions. Thus, recursion is used in this approach.

This approach is used to solve problems that have multiple solutions.

Rules

  1. use number between 1-9 only
  2. Each column must contain all of the numbers 1 through 9 and no two numbers in the same column of a Sudoku puzzle can be the same.
  3. Each row must contain all of the numbers 1 through 9 and no two numbers in the same row of a Sudoku puzzle can be the same.
  4. Each block(3x3) must contain all of the numbers 1 through 9 and no two numbers in the same block of a Sudoku puzzle can be the same.