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 =
19 8 23 10 11
21 1 2 3 4
5 12 18 24 15
16 22 9 7 20
6 17 13 14 25
Maximum product of your matrix = 464100
Minimum product of your matrix = 504
Kurchan score of your matrix = 463596
|
1836 Solvers
819 Solvers
Flip the main diagonal of a matrix
506 Solvers
Combinations without using nchoosek
66 Solvers
Add a row of zeros on top of a matrix
193 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!