Cody

Solution 580835

Submitted on 12 Feb 2015 by Romain Dupouy
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
%% x = 5; y_correct = 79; assert(isequal(your_fcn_name(x),y_correct))

y = 0 0 0 0 79 y = 0 0 0 0 79 0 0 4 y = 0 0 0 0 79 0 0 4 0 0 0 0 0 0 0 12 y = Columns 1 through 29 0 0 0 0 79 0 0 4 0 0 0 0 0 0 0 12 0 0 0 0 0 0 0 0 0 0 0 0 0 Column 30 30 ans = 79

2   Pass
%% x = [2 2 2 2]; y_correct = 4; assert(isequal(your_fcn_name(x),y_correct))

y = 0 0 0 0 79 y = 0 0 0 0 79 0 0 4 y = 0 0 0 0 79 0 0 4 0 0 0 0 0 0 0 12 y = Columns 1 through 29 0 0 0 0 79 0 0 4 0 0 0 0 0 0 0 12 0 0 0 0 0 0 0 0 0 0 0 0 0 Column 30 30 ans = 4

3   Pass
%% x = [5 12 13]; y_correct = 30; assert(isequal(your_fcn_name(x),y_correct))

y = 0 0 0 0 79 y = 0 0 0 0 79 0 0 4 y = 0 0 0 0 79 0 0 4 0 0 0 0 0 0 0 12 y = Columns 1 through 29 0 0 0 0 79 0 0 4 0 0 0 0 0 0 0 12 0 0 0 0 0 0 0 0 0 0 0 0 0 Column 30 30 ans = 30

4   Pass
%% x = [2 6 2 6]; y_correct = 12; assert(isequal(your_fcn_name(x),y_correct))

y = 0 0 0 0 79 y = 0 0 0 0 79 0 0 4 y = 0 0 0 0 79 0 0 4 0 0 0 0 0 0 0 12 y = Columns 1 through 29 0 0 0 0 79 0 0 4 0 0 0 0 0 0 0 12 0 0 0 0 0 0 0 0 0 0 0 0 0 Column 30 30 ans = 12