Cody

Solution 1497459

Submitted on 19 Apr 2018 by Gareth Lee
  • Size: 19
  • This is the leading solution.
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 = []; y_correct = 0; assert(isequal(uniqueNum(x),y_correct))

2   Pass
x = [1 7 7 1 7 6 3 7 6 7 3]; y_correct = 7; assert(isequal(uniqueNum(x),y_correct))

3   Pass
x = [21 62 85 21 85 13 49 5 56 20 62 37 4 4 63 49 56 20 63 37 5 ]; y_correct = 13; assert(isequal(uniqueNum(x),y_correct))

4   Pass
x = 1; y_correct = 1; assert(isequal(uniqueNum(x),y_correct))

5   Pass
[x, y] = test(1000, 1000); assert(isequal(uniqueNum(x),y)) function [input, unique] = test(n,m) unique = randi(n); array = [reshape(repmat(randi(n, 1, m), 2,1),1,[]), unique]; input = array(randperm(2*m+1)); end

Suggested Problems