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))
|
1159 Solvers
Back to basics 11 - Max Integer
678 Solvers
56 Solvers
Sum the entries of each column of a matrix which satisfy a logical condition.
136 Solvers
413 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!