This is an Expo project created with create-expo-app
.
-
Install dependencies
npm install
-
Start the app
npx expo start
Each row contains all digits from 1 to 9.
Each column contains all digits from 1 to 9.
Each 3x3 subgrid contains all digits from 1 to 9.
Backtracking is the most common and intuitive approach for solving Sudoku puzzles. It's essentially a brute-force method with a smart pruning strategy. How it works:
Find an empty cell: Start by finding an empty cell in the Sudoku grid.
Try numbers: For each possible number (1-9) in that cell:
Check if the number is valid (doesn't exist in the same row, column, or 3x3 subgrid).
If valid, recursively call the solving function for the next empty cell.
Backtrack: If none of the numbers work for the current cell, backtrack to the previous cell and try a different number.