Problem 45275. Solve Sudoku puzzle step by
Sudoku is a famous puzzle. https://en.wikipedia.org/wiki/Sudoku
Give a standard sudoku by a matrix (9*9), You need give a position(row and column) and a digital(1-9).
For example,
m = [5 0 0 0 0 6 0 0 0 9 0 0 0 0 0 2 7 0 0 0 8 0 0 7 4 0 0 0 2 0 3 9 0 0 0 0 1 0 0 0 0 0 0 0 8 0 0 0 0 4 2 0 6 0 0 0 7 4 0 0 8 0 0 0 5 1 0 0 0 0 0 4 0 0 0 6 0 0 0 0 9]
you need to return row = 5, col = 8, d = 2, because the subsquares need number 2 and any other position of this subsquares are forbidden. The solution are not unqiue.
Solution Stats
Problem Comments
-
4 Comments
Hello BinBin,
This is a good problem! But I am wondering: In the test suite, shouldn't the statement "tt = mat2cell(s,[3,3,3],[3,3,3]);" be inside the for-loop?
@William, Thank you very much, you are right. I will fix it later because I can't edit it now.
I have fix it. Thanks you. @William
The problem statement is quite unclear. Or incomplete for explaining the problem clearly.
Solution Comments
Show commentsProblem Recent Solvers6
Suggested Problems
-
2311 Solvers
-
Find common elements in matrix rows
2632 Solvers
-
What is the distance from point P(x,y) to the line Ax + By + C = 0?
372 Solvers
-
Lychrel Number Test (Inspired by Project Euler Problem 55)
98 Solvers
-
Volume of a sphere given its surface area
148 Solvers
More from this Author17
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!