Cody

Problem 641. Make a random, non-repeating vector.

Solution 1944315

Submitted on 20 Sep 2019 by Stephen Hughes
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
n = 10; flagSame = isequal(makeRandomOrdering(n), makeRandomOrdering(n)); flagAllUsed = isequal([1:n],sort(makeRandomOrdering(n))); assert(~flagSame & flagAllUsed)

vec = 7 2 8 10 1 9 6 5 3 4 vec = 5 10 4 8 2 9 6 3 7 1 vec = 6 1 3 9 4 8 10 2 7 5