Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = 10;
y=2:10;
y_correct = 1;
assert(isequal(find_missing_number(x,y),y_correct))
|
2 | Pass |
x = 100;
y=1:99;
y_correct = 100;
assert(isequal(find_missing_number(x,y),y_correct))
|
3 | Pass |
x = 1000;
y=1:1000;
y(end/2)=[];
y_correct = 500;
assert(isequal(find_missing_number(x,y),y_correct))
|
4 | Pass |
x = 2;
y=2;
assert(isequal(find_missing_number(x,y),1))
|
5 | Pass |
x = 2;
y=1;
assert(isequal(find_missing_number(x,y),x))
|
6 | Pass |
x = 100000;
y=1:x;
y(end-3)=[];
assert(isequal(find_missing_number(x,y),x-3))
|
7 | Pass |
x = 100000;
for b=1:100
y=1:x;
y=y(randperm(x));
val=randi([1 x]);
y_correct = y(val);
y(val)=[];
assert(isequal(find_missing_number(x,y),y_correct))
end
|
3968 Solvers
4331 Solvers
432 Solvers
484 Solvers
Add a row of zeros on top of a matrix
193 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!