Cody

Solution 1559044

Submitted on 13 Jun 2018 by pardeep parashar
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))

s = 1

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

s = 1 s = 3 s = 6

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

s = 1 s = 3 s = 6 s = 10 s = 15

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

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

Suggested Problems

More from this Author95