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 =
9 6 3
8 5 1
2 7 4
Elapsed time is 0.818304 seconds.
K =
198
|
874 Solvers
Project Euler: Problem 10, Sum of Primes
707 Solvers
Choose the best fitting dominoes
171 Solvers
394 Solvers
249 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!