Cody

Solution 1287227

Submitted on 15 Oct 2017 by Alexis Marchesi
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 = 1; y_correct = 1; assert(isequal(vecsum(x),y_correct))

s = 0 s = 1 y = 1

2   Pass
x = [1 2 3 5]; y_correct = 11; assert(isequal(vecsum(x),y_correct))

s = 0 s = 1 s = 3 s = 6 s = 11 y = 11

3   Pass
x = [1 2 3 5]; y_correct = 11; assert(isequal(vecsum(x),y_correct))

s = 0 s = 1 s = 3 s = 6 s = 11 y = 11

4   Pass
x = 1:100; y_correct = 5050; assert(isequal(vecsum(x),y_correct))

s = 0 s = 1 s = 3 s = 6 s = 10 s = 15 s = 21 s = 28 s = 36 s = 45 s = 55 s = 66 s = 78 s = 91 s = 105 s = 120 s = 136 s = 153 s = 171 s = 190 s = 210 s = 231 s = 253 s = 276 s = 300 s = 325 s = 351 s = 378 s = 406 s = 435 s = 465 s = 496 s = 528 s = 561 s = 595 s = 630 s = 666 s = 703 s = 741 s = 780 s = 820 s = 861 s = 903 s = 946 s = 990 s = 1035 s = 1081 s = 1128 s = 1176 s = 1225 s = 1275 s = 1326 s = 1378 s = 1431 s = 1485 s = 1540 s = 1596 s = 1653 s = 1711 s = 1770 s = 1830 s = 1891 s = 1953 s = 2016 s = 2080 s = 2145 s = 2211 s = 2278 s = 2346 s = 2415 s = 2485 s = 2556 s = 2628 s = 2701 s = 2775 s = 2850 s = 2926 s = 3003 s = 3081 s = 3160 s = 3240 s = 3321 s = 3403 s = 3486 s = 3570 s = 3655 s = 3741 s = 3828 s = 3916 s = 4005 s = 4095 s = 4186 s = 4278 s = 4371 s = 4465 s = 4560 s = 4656 s = 4753 s = 4851 s = 4950 s = 5050 y = 5050