Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
a=[1 1 2 3 4 5 6 7 8]; b=[1 3 4 5 6 7];
y_correct=[1 2 8];
assert(isequal(new_setdiff(a,b),y_correct))
assert(isequal(new_setdiff(fliplr(a),b),y_correct))
assert(isequal(new_setdiff(a,fliplr(b)),y_correct))
ans =
1 2 8
ans =
1 2 8
ans =
1 2 8
|
2 | Pass |
a=repmat([1:10],1,2);
b=repmat([1:5],1,2);
y_correct=[6 6 7 7 8 8 9 9 10 10];
assert(isequal(new_setdiff(a,b),y_correct))
ans =
6 6 7 7 8 8 9 9 10 10
|
3 | Pass |
a=[randperm(10) 3 5 7];
b=randperm(6)+1;
y_correct=[1 3 5 7 8 9 10];
assert(isequal(new_setdiff(a,b),y_correct))
ans =
1 3 5 7 8 9 10
|
4 | Pass |
a=[-5:5 -4:4];
b=[-4:4];
y_correct=[-5:5]
assert(isequal(new_setdiff(a,b),y_correct))
y_correct =
-5 -4 -3 -2 -1 0 1 2 3 4 5
ans =
-5 -4 -3 -2 -1 0 1 2 3 4 5
|
5 | Pass |
a=[2 2 2 2 3 3 5 7];
b=[2 2 2 2 3 3 5];
y_correct=8;
assert(isequal(new_setdiff(a,b),y_correct-1))
ans =
7
|
6 | Fail |
a=[21 124 23 20 21 23 124];
b=[20 21 21 23 23];
y_correct=[124 124]
assert(isequal(new_setdiff(a,b),y_correct))
y_correct =
124 124
ans =
1×0 empty double row vector
|
It dseon't mettar waht oedrr the lrettes in a wrod are.
653 Solvers
Given an unsigned integer x, find the largest y by rearranging the bits in x
781 Solvers
Set the array elements whose value is 13 to 0
941 Solvers
559 Solvers
445 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!