The goal of this challenge is to implement algorithm to solve given 3 sudoku puzzles.
-
A sudoku is type of puzzle made out of 9x9 (81) numbers/cells which is considered to be further divided into 9 sub-grids of 3x3 matrix.
-
A valid sudoku contains the numbers 1-9 each 9 times while not breaking one simple rule: "A sub-grid, column or row can only contain each number once".
i.e Sudoku puzzle can be viewed as matrix is 9x9.
- Rows are counted from top to bottom.
- Rows are horizontal, counted vertically, defined by
y
. - Columns are counted from left to right.
- Columns are counted horizontally, defined by
x
The application will send you 3 different sudoku puzzles in the form of two-dimensional array. You can refer the testsudoku.py to see the details of tests you need to pass.
Note:
- You should use Solve function in sudoku.py to solve the challenge.
- Some sudoku has multiple solutions, but all of puzzles we provide have a unique solution.
9 | 8 | 5 | 1 | |||||
5 | 1 | 9 | 7 | 4 | 2 | |||
2 | 9 | 4 | 1 | 6 | 5 | |||
1 | 4 | 5 | 8 | 9 | 3 | |||
2 | 6 | 7 | 9 | 5 | 8 | |||
5 | 1 | 3 | 6 | |||||
3 | 2 | 6 | ||||||
9 | 3 | 5 | 1 | |||||
1 | 8 | 6 | 4 | |||||
8 | 1 | 2 | 9 | |||||
7 | 8 | |||||||
6 | 7 | 8 | 2 | |||||
2 | 6 | 9 | 5 | |||||
8 | 2 | 3 | 9 | |||||
5 | 1 | 3 |
9 | 4 | 2 | 7 | |||||
1 | ||||||||
7 | 6 | 5 | ||||||
8 | 9 | |||||||
2 | 9 | 4 | 6 | |||||
4 | 2 | |||||||
1 | 6 | 7 | ||||||
3 | ||||||||
3 | 5 | 7 | 2 |
Initially all the tests will fail with following output
codecheck: Finish with code 1
codecheck: tests : 3
codecheck: success: 0
codecheck: failure: 3
Solve the challenge to pass the tests
codecheck: Finish with code 0
codecheck: tests : 3
codecheck: success: 3
codecheck: failure: 0
To run tests locally install codecheck in local environment by running following command in terminal.
$ npm install codecheck -g
To run tests locally, run codecheck
command in terminal in the root folder
To run tests in web editor please click on RUN
button on left side of web editor
In answer.md write a brief explanation
- About how your code works
- Problems faced while solving the challenge
- How you solved those problems