The idea to solve this problem is very simple.
In each row or each column you just have to check among 1 to 4 digits which digit is not available.
Then just fill up each row or each column of the matrix with those unavailable digits.
Example :
*123\n
*432\n
*214\n
*341\n
In this matrix if you observe the first row you will notice that only '4' is not available, so we will fill that index with '4'.
Then we will have below matrix :
4123\n
*432\n
*214\n
*341\n

2nd step :
4123\n
1432\n
*214\n
*341\n
Here we filled up the {2,1} index with '1' .
,,,,,,,,,,,,
Following the above technique we will try to solve all the rows :
Then we will have :
4123\n
1432\n
3214\n
2341\n
By applying similar approach you can solve the grid if its one column or one diagonal is remain unsolved.

Statistics

95% Solution Ratio
mahdi.hasnatEarliest, Oct '20
mahdi.hasnatFastest, 0.0s
mahdi.hasnatLightest, 131 kB
abid1729Shortest, 444B
Toph uses cookies. By continuing you agree to our Cookie Policy.