Cody

Solution 2132247

Submitted on 18 Feb 2020 by O.Ib
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))

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

t = 5 i = 1 t = 6 i = 0

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

t = 9 i = 3 t = 12 i = 2 t = 14 i = 1 t = 15 i = 0

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

t = 59 i = 28 t = 87 i = 27 t = 114 i = 26 t = 140 i = 25 t = 165 i = 24 t = 189 i = 23 t = 212 i = 22 t = 234 i = 21 t = 255 i = 20 t = 275 i = 19 t = 294 i = 18 t = 312 i = 17 t = 329 i = 16 t = 345 i = 15 t = 360 i = 14 t = 374 i = 13 t = 387 i = 12 t = 399 i = 11 t = 410 i = 10 t = 420 i = 9 t = 429 i = 8 t = 437 i = 7 t = 444 i = 6 t = 450 i = 5 t = 455 i = 4 t = 459 i = 3 t = 462 i = 2 t = 464 i = 1 t = 465 i = 0

Suggested Problems

More from this Author95