Cody

# Problem 980. Unique values without using UNIQUE function

Solution 2013167

Submitted on 11 Nov 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
filetext = fileread('your_fcn_name.m') assert(isempty(strfind(filetext, 'unique'))) assert(isempty(strfind(filetext, 'stable'))) A = [9 2 9 5]; assert(isequal(your_fcn_name(A),unique(A,'stable')))

filetext = 'function y = your_fcn_name(x) y = unique(x,'stable') end %This code written by profile_id 16750131 '

Assertion failed.

2   Pass
x = [42 1 1 1 42 17 17]; assert(isequal(your_fcn_name(x),unique(x,'stable')))

y = 42 1 17

3   Pass
x = rand(1,25); assert(isequal(your_fcn_name(x),unique(x,'stable')))

y = Columns 1 through 18 0.8194 0.5189 0.2858 0.8574 0.8637 0.9651 0.0751 0.1323 0.6550 0.1292 0.2344 0.9346 0.7863 0.8082 0.9660 0.3593 0.3672 0.6288 Columns 19 through 25 0.8669 0.0661 0.9733 0.2845 0.9167 0.8445 0.2989