Skip to content

Comments

Create sudoko.cpp#599

Open
aditya-chouksey wants to merge 1 commit intoOpen-Source-you:mainfrom
aditya-chouksey:patch-2
Open

Create sudoko.cpp#599
aditya-chouksey wants to merge 1 commit intoOpen-Source-you:mainfrom
aditya-chouksey:patch-2

Conversation

@aditya-chouksey
Copy link

The grid uses 0 to represent empty cells.

The isSafe() function ensures no duplicates in a row, column, or 3×3 box.

The solveSudoku() uses backtracking:

Tries a number 1–9 in each empty cell.

If a number works, moves to the next cell.

If stuck, it backtracks and tries a different number.

The final grid is printed as the solution.

The grid uses 0 to represent empty cells.

The isSafe() function ensures no duplicates in a row, column, or 3×3 box.

The solveSudoku() uses backtracking:

Tries a number 1–9 in each empty cell.

If a number works, moves to the next cell.

If stuck, it backtracks and tries a different number.

The final grid is printed as the solution.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant