Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
y = kurchan_4x4
uy=unique(y(:));
assert(isequal(uy,[1:16]'));
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 =
1 5 9 13
2 6 10 14
3 7 11 15
4 8 12 16
Maximum product of your matrix = 43680
Minimum product of your matrix = 24
Kurchan score of your matrix = 43656
|
Back to basics 4 - Search Path
321 Solvers
Vectorize the digits of an Integer
269 Solvers
Output any real number that is neither positive nor negative
316 Solvers
186 Solvers
Check that number is whole number
1070 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!