Cody

Solution 2195981

Submitted on 6 Apr 2020 by Luke McCarvill
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; t = 1; assert(isequal(triangle(n),t))

i = 2

2   Pass
n = 3; t = 6; assert(isequal(triangle(n),t))

i = 2 i = 3 i = 4

3   Pass
n = 5; t = 15; assert(isequal(triangle(n),t))

i = 2 i = 3 i = 4 i = 5 i = 6

4   Pass
n = 30; t = 465; assert(isequal(triangle(n),t))

i = 2 i = 3 i = 4 i = 5 i = 6 i = 7 i = 8 i = 9 i = 10 i = 11 i = 12 i = 13 i = 14 i = 15 i = 16 i = 17 i = 18 i = 19 i = 20 i = 21 i = 22 i = 23 i = 24 i = 25 i = 26 i = 27 i = 28 i = 29 i = 30 i = 31

Suggested Problems

More from this Author95