Cody

Solution 1973694

Submitted on 13 Oct 2019 by Nikolaos Nikolaou
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
M = 1; N = 1; y_correct = [2]; assert(isequal(sumMyIndices(M,N),y_correct))

y = 0 a = 1 b = 1 y = 2

2   Pass
M = 1; N = 2; y_correct = [2,3]; assert(isequal(sumMyIndices(M,N),y_correct))

y = 0 0 a = 1 b = 1 y = 2 0 a = 1 b = 2 y = 2 3

3   Pass
M = 3; N = 2; y_correct = [2,3; 3,4; 4,5]; assert(isequal(sumMyIndices(M,N),y_correct))

y = 0 0 0 0 0 0 a = 1 b = 1 y = 2 0 0 0 0 0 a = 2 b = 1 y = 2 0 3 0 0 0 a = 3 b = 1 y = 2 0 3 0 4 0 a = 1 b = 2 y = 2 3 3 0 4 0 a = 2 b = 2 y = 2 3 3 4 4 0 a = 3 b = 2 y = 2 3 3 4 4 5

4   Pass
M = 3; N = 3; y_correct = [2,3,4; 3,4,5; 4,5,6]; assert(isequal(sumMyIndices(M,N),y_correct))

y = 0 0 0 0 0 0 0 0 0 a = 1 b = 1 y = 2 0 0 0 0 0 0 0 0 a = 2 b = 1 y = 2 0 0 3 0 0 0 0 0 a = 3 b = 1 y = 2 0 0 3 0 0 4 0 0 a = 1 b = 2 y = 2 3 0 3 0 0 4 0 0 a = 2 b = 2 y = 2 3 0 3 4 0 4 0 0 a = 3 b = 2 y = 2 3 0 3 4 0 4 5 0 a = 1 b = 3 y = 2 3 4 3 4 0 4 5 0 a = 2 b = 3 y = 2 3 4 3 4 5 4 5 0 a = 3 b = 3 y = 2 3 4 3 4 5 4 5 6

5   Pass
M = 4; N = 5; y_correct = [ 2 3 4 5 6 3 4 5 6 7 4 5 6 7 8 5 6 7 8 9 ]; assert(isequal(sumMyIndices(M,N),y_correct))

y = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 a = 1 b = 1 y = 2 0 0 0 0 0 0 0 0 0 0 0 0 0 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