Cody

Solution 2055883

Submitted on 12 Dec 2019 by Nando Käslin
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 = 0; correct = [1]; assert(isequal(pascalTri(n),correct))

2   Pass
n = 1; correct = [1 1]; assert(isequal(pascalTri(n),correct))

3   Pass
n = 2; correct = [1 2 1]; assert(isequal(pascalTri(n),correct))

a = 2

4   Pass
n = 3; correct = [1 3 3 1]; assert(isequal(pascalTri(n),correct))

a = 2 a = 3 a = 3 3

5   Pass
n = 10; correct = [1 10 45 120 210 252 210 120 45 10 1]; assert(isequal(pascalTri(n),correct))

a = 2 a = 3 a = 3 3 a = 4 a = 4 6 a = 4 6 4 a = 5 a = 5 10 a = 5 10 10 a = 5 10 10 5 a = 6 a = 6 15 a = 6 15 20 a = 6 15 20 15 a = 6 15 20 15 6 a = 7 a = 7 21 a = 7 21 35 a = 7 21 35 35 a = 7 21 35 35 21 a = 7 21 35 35 21 7 a = 8 a = 8 28 a = 8 28 56 a = 8 28 56 70 a = 8 28 56 70 56 a = 8 28 56 70 56 28 a = 8 28 56 70 56 28 8 a = 9 a = 9 36 a = 9 36 84 a = 9 36 84 126 a = 9 36 84 126 126 a = 9 36 84 126 126 84 a = 9 36 84 126 126 84 36 a = 9 36 84 126 126 84 36 9 a = 10 a = 10 45 a = 10 45 120 a = 10 45 120 210 a = 10 45 120 210 252 a = 10 45 120 210 252 210 a = 10 45 120 210 252 210 120 a = 10 45 120 210 252 210 120 45 a = 10 45 120 210 252 210 120 45 10