This is a C++ program that solves a 9x9 Sudoku puzzle by using backtracking algorithm.
How to Use
Clone this repository to your local machine. (Better copy this code into a new file in your system)
Open the terminal or command prompt and navigate to the directory where you cloned this repository.
Compile the program by running the command: g++ -o SUDOKU SUDOKU.cpp (replace SUDOKU with your filename)
Run the program by using the following command: ./SUDOKU (replace SUDOKU with your filename)
Enter the unsolved Sudoku puzzle as a 9x9 matrix, where empty cells are represented by 0. For example:
0 0 0 2 6 0 7 0 1
6 8 0 0 7 0 0 9 0
1 9 0 0 0 4 5 0 0
8 2 0 1 0 0 0 4 0
0 0 4 6 0 2 9 0 0
0 5 0 0 0 3 0 2 8
0 0 9 3 0 0 0 7 4
0 4 0 0 5 0 0 3 6
7 0 3 0 1 8 0 0 0
Press enter to display the solution if possible, otherwise the program will display a message indicating that no solution exists!