Cody

# Problem 2650. Kurchan 4x4 - Optimal score

Solution 2719863

Submitted on 21 Jul 2020 by Rafael S.T. Vieira
• Size: 9
• This is the leading solution.
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_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 = 16 11 8 2 5 4 13 10 9 15 1 7 3 6 12 14 Maximum product of your matrix = 4620 Minimum product of your matrix = 896 Kurchan score of your matrix = 3724

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!