Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
y = kurchan_5x5
uy=unique(y(:));
assert(isequal(uy,[1:25]'));
dg = @(mm) spdiags([mm mm],1:length(mm));
py=prod([y y' dg(y) dg(flipud(y))]);
cody_score=max(py)-min(py);
fprintf('Maximum product of your matrix = %.0f \n',max(py))
fprintf('Minimum product of your matrix = %.0f \n',min(py))
fprintf('Kurchan score of your matrix = %.0f \n',cody_score)
feval(@assignin,'caller','score',cody_score);
y =
8 3 17 20 13
18 25 12 1 15
2 7 14 22 24
19 21 5 11 6
23 10 9 16 4
Maximum product of your matrix = 132480
Minimum product of your matrix = 77440
Kurchan score of your matrix = 55040
|
1600 Solvers
Back to basics 22 - Rotate a matrix
763 Solvers
725 Solvers
856 Solvers
Number of digits in an integer
336 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!