Cody

Solution 1973874

Submitted on 13 Oct 2019
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   Fail
x = 10; y=2:10; y_correct = 1; assert(isequal(find_missing_number(x,y),y_correct))

Assertion failed.

2   Pass
x = 100; y=1:99; y_correct = 100; assert(isequal(find_missing_number(x,y),y_correct))

3   Fail
x = 1000; y=1:1000; y(end/2)=[]; y_correct = 500; assert(isequal(find_missing_number(x,y),y_correct))

Assertion failed.

4   Fail
x = 2; y=2; assert(isequal(find_missing_number(x,y),1))

Assertion failed.

5   Pass
x = 2; y=1; assert(isequal(find_missing_number(x,y),x))

6   Fail
x = 100000; y=1:x; y(end-3)=[]; assert(isequal(find_missing_number(x,y),x-3))

Assertion failed.

7   Fail
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

Assertion failed.