Cody

Solution 1932389

Submitted on 12 Sep 2019
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
x = 1;y_correct = 1;assert(isequal(partitions(x),y_correct))

y = 1

2   Fail
x = 5;y_correct = 7;assert(isequal(partitions(x),y_correct))

y = 5

Assertion failed.

3   Fail
x = 50;y_correct = 204226;assert(isequal(partitions(x),y_correct))

y = 50

Assertion failed.

4   Fail
assert(isequal(partitions(partitions(partitions(partitions(5)))),476715857290));

y = 5 y = 5 y = 5 y = 5

Assertion failed.

5   Fail
assert(isequal(partitions(partitions(partitions(6))),526823));

y = 6 y = 6 y = 6

Assertion failed.

6   Fail
assert(isequal(partitions(partitions(12)),10619863));

y = 12 y = 12

Assertion failed.

7   Fail
assert(isequal(partitions(199),3646072432125))

y = 199

Assertion failed.

8   Fail
P=arrayfun(@(x) partitions(x),10:10:100); y_correct=[42 627 5604 37338 204226 966467 4087968 15796476 56634173 190569292]; assert(all(isequal(P,y_correct)))

y = 10 y = 20 y = 30 y = 40 y = 50 y = 60 y = 70 y = 80 y = 90 y = 100

Assertion failed.