Adapted description and extended testdata
This commit is contained in:
26
README.md
26
README.md
@@ -1,21 +1,31 @@
|
||||
# Sudoku verifier
|
||||
# Validate a Sudoku
|
||||
|
||||
## Definition
|
||||
Sudokus are logic number puzzles in which cells in a 9×9 grid must be populated with
|
||||
the digits 1 to 9 in a way that each digit occurrs only once in each unit (that is column,
|
||||
row or block = 3×3 sub grid).
|
||||
Sudokus are number-puzzles in which cells in a 9×9 grid must be populated with the numbers `1` to `9`.
|
||||
|
||||
The following constraints must apply to the 9×9 grid.
|
||||
|
||||
* Each digit from `1` to `9` only occurs only once
|
||||
* per row
|
||||
* per column
|
||||
* per block (i.e. 3×3 sub grid)
|
||||
|
||||

|
||||
|
||||
## Goal
|
||||
Validate if a given solution for a Sudoku is valid, by checking that the digit
|
||||
1 to 9 appear only once in column, in each row and in each of the 9 sub grids.
|
||||
Validate, if a given Sudoku is a valid solution.
|
||||
|
||||
The Sudoku must comply with the definition above.
|
||||
|
||||
### Input
|
||||
a sequence of 81 digits, organized in 9 columns and 9 rows
|
||||
A sequence of 81 digits, organized in 9 columns and 9 rows.
|
||||
|
||||
The columns of a row are separated by blanks.
|
||||
|
||||
Rows are separated by line-breaks.
|
||||
|
||||
### Output
|
||||
A boolean value, if the grid is valid.
|
||||
A boolean value `true` or `false` defining the correctness of the input.
|
||||
|
||||
### Constraints
|
||||
1 <= `digit` <= 9
|
||||
|
||||
Reference in New Issue
Block a user