Cody

Solution 1444343

Submitted on 19 Feb 2018 by Doddy Kastanya
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
A = magic(4); correct = 15; assert(isequal(minimax(A),correct))

2   Pass
A = magic(5); correct = 21; assert(isequal(minimax(A),correct))

3   Pass
A = magic(6); n = randi(1024); correct = 34; assert(isequal(minimax(A+n),correct+n))

4   Pass
A = [1 2 3; 0 4 5; 6 0 0]; correct = 5; assert(isequal(minimax(A),correct))

5   Pass
A = [1 2 3; 0 4 0; 6 0 5]; correct = 4; assert(isequal(minimax(A),correct))

6   Pass
A = rand(7)+diag(randperm(7)); assert(isequal(floor(minimax(A)),1))

7   Pass
B = [1 2 1; 0 1 0]; correct = 2; assert(isequal(minimax(B),correct))

8   Pass
B = magic(6)+magic(6)'; correct = 61; assert(isequal(minimax(B),correct)) % other test suggestions highly welcome

Suggested Problems

More from this Author47