Java
Java copied to clipboard
[FEATURE REQUEST] Add Sudoku Solver using Backtracking
What would you like to Propose?
Title: Add Sudoku Solver using Backtracking
š§ Overview
Iād like to contribute a Sudoku Solver algorithm using the Backtracking technique. This algorithm systematically explores all valid placements of digits in a 9Ć9 Sudoku grid until it finds a valid solution that satisfies all Sudoku constraints.
š§© Problem Description
Given a partially filled 9Ć9 Sudoku board, fill all empty cells (represented by 0) such that every row, column, and 3Ć3 subgrid contains the digits 1 through 9 exactly once.
š Implementation Details
- Folder:
src/main/java/com/thealgorithms/backtracking/ - Filename:
SudokuSolver.java - Approach: Depth-first backtracking algorithm that tries valid numbers recursively and backtracks on invalid placements.
ā Expected Deliverables
- Clean, modular implementation (e.g.,
isValid(),solveSudoku()methods). - Example
main()method demonstrating functionality. - Unit tests validating correctness on solvable and unsolvable grids.
- Clear in-code documentation and time complexity notes.
š§āš» Additional Notes
Backtracking is one of the most intuitive ways to solve Sudoku and a great educational addition to the repository. I have a working version ready and would like to open a PR once this issue is approved.
Issue details
š§© Problem Description
Given a partially filled 9Ć9 Sudoku board, fill all empty cells (represented by 0) such that every row, column, and 3Ć3 subgrid contains the digits 1 through 9 exactly once.
Additional Information
No response