Cody

# Problem 42586. Find Missing Number

Solution 1282771

Submitted on 7 Oct 2017 by Shriramprasad Venkatesan
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))

res = 1

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

res = 100

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

res = 500

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

res = 1

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

res = 2

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

res = 99997

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

res = 64724 res = 30440 res = 38019 res = 73228 res = 57669 res = 4231 res = 24499 res = 30249 res = 73469 res = 51311 res = 16169 res = 80999 res = 83512 res = 12302 res = 9143 res = 94515 res = 3966 res = 77810 res = 27504 res = 45280 res = 33101 res = 82430 res = 19635 res = 19280 res = 31042 res = 82274 res = 11459 res = 73423 res = 39893 res = 61972 res = 26698 res = 9753 res = 29758 res = 48167 res = 26034 res = 91403 res = 41369 res = 89651 res = 77498 res = 14107 res = 30795 res = 16232 res = 9743 res = 68595 res = 10286 res = 42368 res = 38666 res = 41076 res = 20668 res = 60889 res = 18216 res = 25943 res = 74127 res = 8662 res = 49077 res = 5649 res = 98348 res = 44706 res = 12764 res = 3006 res = 7818 res = 60179 res = 79128 res = 7574 res = 3086 res = 85475 res = 53436 res = 8552 res = 88933 res = 50125 res = 13439 res = 30905 res = 24357 res = 24669 res = 63850 res = 6742 res = 41789 res = 15724 res = 30218 res = 96441 res = 28035 res = 99204 res = 41751 res = 54581 res = 97894 res = 55898 res = 37552 res = 71873 res = 19142 res = 56042 res = 8770 res = 11492 res = 27965 res = 13317 res = 36090 res = 6142 res = 40237 res = 18843 res = 96324 res = 27148