Cody

# Problem 43684. 0, 2, 0, -2, 0, 2, 0, -2, ...

Solution 1062260

Submitted on 27 Nov 2016 by JAEHYUK WOO
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
n = 1; y_correct = [0]; assert(isequal(seq(n),y_correct))

y = 0

2   Pass
n = 4 y_correct = [0, 2, 0, -2]; assert(isequal(seq(n),y_correct))

n = 4 y = 0 y = 0 2 y = 0 2 0 y = 0 2 0 2 y = 0 2 0 -2

3   Pass
n = 5 y_correct = [0, 2, 0, -2, 0]; assert(isequal(seq(n),y_correct))

n = 5 y = 0 y = 0 2 y = 0 2 0 y = 0 2 0 2 y = 0 2 0 -2 y = 0 2 0 -2 0

4   Pass
n = 8 y_correct = [0, 2, 0, -2, 0, 2, 0, -2]; assert(isequal(seq(n),y_correct))

n = 8 y = 0 y = 0 2 y = 0 2 0 y = 0 2 0 2 y = 0 2 0 -2 y = 0 2 0 -2 0 y = 0 2 0 -2 0 2 y = 0 2 0 -2 0 2 0 y = 0 2 0 -2 0 2 0 2 y = 0 2 0 -2 0 2 0 -2

5   Pass
n = 25 y_correct = [0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0, 2, 0, -2, 0]; assert(isequal(seq(n),y_correct))

n = 25 y = 0 y = 0 2 y = 0 2 0 y = 0 2 0 2 y = 0 2 0 -2 y = 0 2 0 -2 0 y = 0 2 0 -2 0 2 y = 0 2 0 -2 0 2 0 y = 0 2 0 -2 0 2 0 2 y = 0 2 0 -2 0 2 0 -2 y = 0 2 0 -2 0 2 0 -2 0 y = 0 2 0 -2 0 2 0 -2 0 2 y = 0 2 0 -2 0 2 0 -2 0 2 0 y = 0 2 0 -2 0 2 0 -2 0 2 0 2 y = 0 2 0 -2 0 2 0 -2 0 2 0 -2 y = 0 2 0 -2 0 2 0 -2 0 2 0 -2 0 y = 0 2 0 -2 0 2 0 -2 0 2 0 -2 0 2 y = 0 2 0 -2 0 2 0 -2 0 2 0 -2 0 2 0 y = 0 2 0 -2 0 2 0 -2 0 2 0 -2 0 2 0 2 y = 0 2 0 -2 0 2 0 -2 0 2 0 -2 0 2 0 -2 y = Columns 1 through 16 0 2 0 -2 0 2 0 -2 0 2 0 -2 0 2 0 -2 Column 17 0 y = Columns 1 through 16 0 2 0 -2 0 2 0 -2 0 2 0 -2 0 2 0 -2 Columns 17 through 18 0 2 y = Columns 1 through 16 0 2 0 -2 0 2 0 -2 0 2 0 -2 0 2 0 -2 Columns 17 through 19 0 2 0 y = Columns 1 through 16 0 2 0 -2 0 2 0 -2 0 2 0 -2 0 2 0 -2 Columns 17 through 20 0 2 0 2 y = Columns 1 through 16 0 2 0 -2 0 2 0 -2 0 2 0 -2 0 2 0 -2 Columns 17 through 20 0 2 0 -2 y = Columns 1 through 16 0 2 0 -2 0 2 0 -2 0 2 0 -2 0 2 0 -2 Columns 17 through 21 0 2 0 -2 0 y = Columns 1 through 16 0 2 0 -2 0 2 0 -2 0 2 0 -2 0 2 0 -2 Columns 17 through 22 0 2 0 -2 0 2 y = Columns 1 through 16 0 2 0 -2 0 2 0 -2 0 2 0 -2 0 2 0 -2 Columns 17 through 23 0 2 0 -2 0 2 0 y = Columns 1 through 16 0 2 0 -2 0 2 0 -2 0 2 0 -2 0 2 0 -2 Columns 17 through 24 0 2 0 -2 0 2 0 2 y = Columns 1 through 16 0 2 0 -2 0 2 0 -2 0 2 0 -2 0 2 0 -2 Columns 17 through 24 0 2 0 -2 0 2 0 -2 y = Columns 1 through 16 0 2 0 -2 0 2 0 -2 0 2 0 -2 0 2 0 -2 Columns 17 through 25 0 2 0 -2 0 2 0 -2 0