Cody

# Problem 42586. Find Missing Number

Solution 787752

Submitted on 3 Dec 2015 by Guillaume
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   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

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!