Cody

Solution 1740582

Submitted on 2 Mar 2019 by Martin C.
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) x=1 y_correct = [4 4] assert(isequal(indexmynum(A,x),y_correct))

A = 16 2 3 13 5 11 10 8 9 7 6 12 4 14 15 1 x = 1 y_correct = 4 4 s = 4 4 A = 16 5 9 4 2 11 7 14 3 10 6 15 13 8 12 1 f = 16 c = 1 c = 2 f = 12 c = 3 f = 8 c = 4 f = 4 y = 4 4

2   Pass
A=magic(6) x=22 y_correct = [3 4] assert(isequal(indexmynum(A,x),y_correct))

A = 35 1 6 26 19 24 3 32 7 21 23 25 31 9 2 22 27 20 8 28 33 17 10 15 30 5 34 12 14 16 4 36 29 13 18 11 x = 22 y_correct = 3 4 s = 6 6 A = 35 3 31 8 30 4 1 32 9 28 5 36 6 7 2 33 34 29 26 21 22 17 12 13 19 23 27 10 14 18 24 25 20 15 16 11 f = 21 c = 1 c = 2 f = 15 c = 3 f = 9 c = 4 f = 3 y = 3 4

Suggested Problems

More from this Author7