Skip to content

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