Cody

Solution 1794006

Submitted on 20 Apr 2019 at 19:15 by Tung Vu Nguyen Nguyen
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))

t = 0 t = 1

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

t = 0 t = 3 t = 5 t = 6

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

t = 0 t = 5 t = 9 t = 12 t = 14 t = 15

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

t = 0 t = 30 t = 59 t = 87 t = 114 t = 140 t = 165 t = 189 t = 212 t = 234 t = 255 t = 275 t = 294 t = 312 t = 329 t = 345 t = 360 t = 374 t = 387 t = 399 t = 410 t = 420 t = 429 t = 437 t = 444 t = 450 t = 455 t = 459 t = 462 t = 464 t = 465

Suggested Problems