Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
tic
m = kurchan_3x3
toc
p=[1 4 7
2 5 8
3 6 9
1 2 3
4 5 6
7 8 9
1 5 9
4 8 3
7 2 6
7 5 3
8 6 1
9 4 2];
assert(isequal((1:9)',unique(m(:)))) % check use 1 thru 9
mp=prod(m(p),2);
K=max(mp)-min(mp) % display K score
% simplified Kurchan scoring for 3x3
assert(K<=198) % Pretty certain 198 is best possible, allow better score
m =
5 4 9
6 1 2
7 3 8
Elapsed time is 0.006556 seconds.
K =
198
|
4598 Solvers
962 Solvers
Read a column of numbers and interpolate missing data
1235 Solvers
405 Solvers
Side of an equilateral triangle
2597 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!