perhaps you should specify that y is in the order of the first occurence of each unique element of x
This would be a better problem if unique and sort functions were not allowed
Nice problem!
Solution without using sort(.) or unique(.) .
Solution without using sort(_) or unique(_) .
Note 1) this solution does not use sort() anywhere :) 2) the more elegant "stable" is not available for unique in pre-2012 MATLAB.
1743 Solvers
329 Solvers
Are all the three given point in the same line?
274 Solvers
Split a string into chunks of specified length
492 Solvers
Is this triangle right-angled?
3010 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!