This is the follow up question to standard Sudoku solver.
You are given a Sudoku grid where .
represents an empty cell and the other cells are filled with numbers 0-8
(inclusive).
Rules:
- All the numbers in Sudoku must appear exactly once in all left-top to right-bottom diagonals.
- All the numbers in Sudoku must appear exactly once in all right-top to left-bottom diagonals.
- All the numbers in Sudoku must appear exactly once in all squares (3*3).
However numbers can repeat in rows or columns.
This is code-golf. Please post your shortest code in any language that solves this problem. Winner will be the shortest solution by byte count.
Input:
. 3 7 . 4 2 . 2 .
5 . 6 1 . . . . 7
. . 2 . . . 5 0 .
2 8 3 . . . . . .
. 5 . . 7 1 2 . 7
. . . 3 . . . . 3
7 . . . . 6 . 5 0
. 2 3 . 3 . 7 4 2
0 5 . . 8 . . . .
Output:
8 3 7 0 4 2 1 2 4
5 0 6 1 8 6 3 6 7
4 1 2 7 3 5 5 0 8
2 8 3 5 4 8 6 0 5
6 5 0 0 7 1 2 1 7
1 4 7 3 2 6 8 4 3
7 8 1 4 1 6 3 5 0
6 2 3 7 3 5 7 4 2
0 5 4 2 8 0 6 8 1