Cody

Solution 1361998

Submitted on 29 Nov 2017 by Anupam Agarwal
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

Test Status Code Input and Output
1   Pass
v = randi(10, 1, randi(10)); s = summ(v); assert(length(s) == length(v) - 1)

2   Pass
v = 1:10; s_correct = 3:2:19; assert(isequal(summ(v),s_correct))

3   Pass
v = [1; 2; 4; 4; 5; 8]; s_correct = [3; 6; 8; 9; 13]; assert(isequal(summ(v),s_correct))