Cody

Solution 2192493

Submitted on 4 Apr 2020 by Nikolaos Nikolaou
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))

out = 1 y = 1

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

out = 7 y = 7

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

out = 204226 y = 204226

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

out = 7 y = 7 out = 15 y = 15 out = 176 y = 176 out = 4.7672e+11 y = 4.7672e+11

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

out = 11 y = 11 out = 56 y = 56 out = 526823 y = 526823

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

out = 77 y = 77 out = 10619863 y = 10619863

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

out = 3.6461e+12 y = 3.6461e+12

8   Pass
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)))

out = 42 y = 42 out = 627 y = 627 out = 5604 y = 5604 out = 37338 y = 37338 out = 204226 y = 204226 out = 966467 y = 966467 out = 4087968 y = 4087968 out = 15796476 y = 15796476 out = 56634173 y = 56634173 out = 190569292 y = 190569292