This is not a valid solution. It does not meet the requirement of elements in each subset being sorted. Try the input [1 3 2] and it does not give sorted subsets.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = [1 1 1];
y ={[],[1]};
assert(isequal(your_fcn_name(x),y))
|
2 | Pass |
x=[1];
y={[],[1]};
assert(isequal(your_fcn_name(x),y))
|
3 | Pass |
x=[1 2 3];
y ={[],[1],[2],[3],[1 2],[1 3],[2 3],[1 2 3]};
assert(isequal(your_fcn_name(x),y))
|
4 | Pass |
x=[1 1 2 3];
y ={[],[1],[2],[3],[1 2],[1 3],[2 3],[1 2 3]};
assert(isequal(your_fcn_name(x),y))
|
5 | Pass |
x=[];
y={[]};
assert(isequal(your_fcn_name(x),y))
|
6 | Pass |
x=[nan nan]; % matlab considers them non-unique, but i don't
y={[],[nan]};
assert(isequalwithequalnans(your_fcn_name(x),y))
|
7 | Pass |
x=[nan nan 1];
y={[],[nan],[1],[nan 1]};
assert(isequalwithequalnans(your_fcn_name(x),y))
|
5369 Solvers
794 Solvers
Project Euler: Problem 1, Multiples of 3 and 5
1064 Solvers
Back to basics 13 - Input variables
203 Solvers
Find the coefficient of a number in scientifc notation
27 Solvers