BYJU Sudoku Solver
BYJU Sudoku Solver
HardRecursion100% accepted
BYJU puzzle section features Sudoku. Write a solver that fills empty cells (marked 0) in a 9x9 board following Sudoku rules: each row, column, and 3x3 box must contain digits 1-9 without repetition.
Approach
Solve a 9x9 Sudoku given as an 81-character row-major string ('0' = empty cell) using backtracking. Return the solved 81-character string. Each puzzle has a unique solution.
Input
534678012072195308198340560059761423426853791713924856961537284087419635340286179
Output
534678912672195348198342567859761423426853791713924856961537284287419635345286179
More Recursion problems
Browse all coding problems →solution.py
Loading editor...
Test 1
Test 2
Test 3
Press Run to test your custom input, or Submit to judge against all test cases.
Sign in to continue
Create a free account to run code, submit solutions and track progress.
- Free forever — no credit card
- 10+ languages with live execution
- Points, streaks & leaderboards