This project is a Sudoku Solver implemented in C++ using a classic backtracking algorithm. The program takes predefined 9×9 Sudoku boards, validates their initial state, and attempts to solve them. If a solution exists, the completed board is printed to the console. Otherwise, the program reports that the puzzle cannot be solved.
Recursive backtracking
Constraint checking (row, column, 3×3 box)
Use of vector<vector> for 2D board representation
Basic input validation
・Solves standard 9×9 Sudoku puzzles
・Detects invalid initial boards (duplicate numbers in rows or columns)
・Uses 0 to represent empty cells
・Handles multiple test boards in a single execution
・Clearly reports whether each board is solvable
- Find the next empty cell (value 0)
- Try numbers from 1 to 9
- Check if the number is valid:
・ Not already in the same row
・ Not already in the same column
・ Not already in the corresponding 3×3 subgrid - Recursively attempt to solve the rest of the board
- If a conflict occurs, reset the cell and backtrack