Cody

Solution 406661

Submitted on 20 Feb 2014 by J.R.! Menzinger
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 = 10000; y_correct = x; z = simplepartition(x); zL = length(z); assert(isequal(sum(unique(z)),y_correct) && zL >= ceil(log2(x)/2)) x = 40190; y_correct = x; z = simplepartition(x); zL = length(z); assert(isequal(sum(unique(z)),y_correct) && zL >= ceil(log2(x)/2)) x = 149; y_correct = x; z = simplepartition(x); zL = length(z); assert(isequal(sum(unique(z)),y_correct) && zL >= ceil(log2(x)/2))

ans = Columns 1 through 8 1 2 3 4 5 6 7 8 Column 9 9964 ans = Columns 1 through 8 1 2 3 4 5 6 7 8 Column 9 40154 ans = 1 2 3 4 5 6 7 8 113