Sudoku Solver
Hard
Backtracking
Matrix
Constraint
Solve a 9x9 Sudoku puzzle.
Input: 9 lines, 9 digits each (0 = empty)
Output: solved grid
Constraints
See problem-specific constraints. Optimized solution required.
Examples
Example 1:
Input: See example
Output:
Example 2:
Input: See example
Output:
Hints
Consider a matrix approach.
Think about time complexity.
Tests:
Runtime:
Memory:
Test
Input:
Expected:
Got:
Click Run Code to test against sample cases, or Submit to test against all cases.
▲ Console