Cody

Solution 2463410

Submitted on 3 Jun 2020 by M Raghu
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))

no = 1 n = 1 y = 0 y = 1 n = 2

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

no = 4 n = 1 y = 0 y = 1 n = 2 y = 3 n = 3 y = 6 n = 4 y = 11 n = 5

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

no = 4 n = 1 y = 0 y = 1 n = 2 y = 3 n = 3 y = 6 n = 4 y = 11 n = 5

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

no = 100 n = 1 y = 0 y = 1 n = 2 y = 3 n = 3 y = 6 n = 4 y = 10 n = 5 y = 15 n = 6 y = 21 n = 7 y = 28 n = 8 y = 36 n = 9 y = 45 n = 10 y = 55 n = 11 y = 66 n = 12 y = 78 n = 13 y = 91 n = 14 y = 105 n = 15 y = 120 n = 16 y = 136 n = 17 y = 153 n = 18 y = 171 n = 19 y = 190 n = 20 y = 210 n = 21 y = 231 n = 22 y = 253 n = 23 y = 276 n = 24 y = 300 n = 25 y = 325 n = 26 y = 351 n = 27 y = 378 n = 28 y = 406 n = 29 y = 435 n = 30 y = 465 n = 31 y = 496 n = 32 y = 528 n = 33 y = 561 n = 34 y = 595 n = 35 y = 630 n = 36 y = 666 n = 37 y = 703 n = 38 y = 741 n = 39 y = 780 n = 40 y = 820 n = 41 y = 861 n = 42 y = 903 n = 43 y = 946 n = 44 y = 990 n = 45 y = 1035 n = 46 y = 1081 n = 47 y = 1128 n = 48 y = 1176 n = 49 y = 1225 n = 50 y = 1275 n = 51 y = 1326 n = 52 y = 1378 n = 53 y = 1431 n = 54 y = 1485 n = 55 y = 1540 n = 56 y = 1596 n = 57 y = 1653 n = 58 y = 1711 n = 59 y = 1770 n = 60 y = 1830 n = 61 y = 1891 n = 62 y = 1953 n = 63 y = 2016 n = 64 y = 2080 n = 65 y = 2145 n = 66 y = 2211 n = 67 y = 2278 n = 68 y = 2346 n = 69 y = 2415 n = 70 y = 2485 n = 71 y = 2556 n = 72 y = 2628 n = 73 y = 2701 n = 74 y = 2775 n = 75 y = 2850 n = 76 y = 2926 n = 77 y = 3003 n = 78 y = 3081 n = 79 y = 3160 n = 80 y = 3240 n = 81 y = 3321 n = 82 y = 3403 n = 83 y = 3486 n = 84 y = 3570 n = 85 y = 3655 n = 86 y = 3741 n = 87 y = 3828 n = 88 y = 3916 n = 89 y = 4005 n = 90 y = 4095 n = 91 y = 4186 n = 92 y = 4278 n = 93 y = 4371 n = 94 y = 4465 n = 95 y = 4560 n = 96 y = 4656 n = 97 y = 4753 n = 98 y = 4851 n = 99 y = 4950 n = 100 y = 5050 n = 101