Cody

Solution 527622

Submitted on 12 Nov 2014 by Michael Ryan
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

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 = 1 17 14 20 18 25 16 7 3 12 15 2 24 23 6 21 9 13 11 5 10 22 4 8 19 Maximum product of your matrix = 136850 Minimum product of your matrix = 78750 Kurchan score of your matrix = 58100

Suggested Problems

More from this Author80