Cody

Problem 43018. Sudoku square

Solution 2705070

Submitted on 17 Jul 2020 by Ramesh Kumar V
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
x=[ 1 5 4; 8 6 3; 0 9 7]; y_correct=[ 1 5 4; 8 6 3; 2 9 7]; assert(isequal(sudoku(x),y_correct))

m = 3 n = 3 z1 = 1 8 0 5 6 9 4 3 7 z2 = 1 2 3 4 5 6 7 8 9 z3 = 2 ind = 9×1 logical array 0 0 1 0 0 0 0 0 0 z4 = 3 z1 = 1 8 2 5 6 9 4 3 7 y = 1 5 4 8 6 3 2 9 7

2   Pass
x=[ 8 3 0; 2 7 1; 5 4 6]; y_correct=[ 8 3 9; 2 7 1; 5 4 6]; assert(isequal(sudoku(x),y_correct))

m = 3 n = 3 z1 = 8 2 5 3 7 4 0 1 6 z2 = 1 2 3 4 5 6 7 8 9 z3 = 9 ind = 9×1 logical array 0 0 0 0 0 0 1 0 0 z4 = 7 z1 = 8 2 5 3 7 4 9 1 6 y = 8 3 9 2 7 1 5 4 6

Suggested Problems

More from this Author12

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!