Cody

Solution 1685569

Submitted on 3 Dec 2018 by Rafael Hernandez-Walls
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
for k=1:20 x=randperm(k); assert(isequal(identity(x),x)); end assert(~isempty(strfind(fileread('identity.m'), '+')),'use +')

x = 1 x = 2 1 x = 2 1 3 x = 3 2 1 4 x = 3 2 1 5 4 x = 6 5 1 4 2 3 x = 1 2 6 3 7 5 4 x = 2 6 8 7 4 3 1 5 x = 9 3 8 5 1 4 2 6 7 x = 10 7 3 8 9 1 2 4 5 6 x = 5 1 11 3 9 4 10 2 6 8 7 x = 4 5 1 6 9 12 2 10 7 3 11 8 x = 10 2 5 3 12 6 8 13 4 7 11 9 1 x = 12 2 10 9 6 1 7 3 14 13 4 8 11 5 x = 6 12 8 5 7 9 3 1 4 13 14 11 10 2 15 x = 7 11 1 10 4 14 2 13 6 5 8 9 3 12 15 16 x = 9 8 5 16 12 7 13 10 1 14 15 6 11 2 17 4 3 x = 7 13 14 10 15 17 18 1 12 11 3 2 8 9 6 16 4 5 x = 9 10 4 2 5 19 8 1 3 6 16 13 7 18 12 15 14 11 17 x = 8 14 15 1 10 11 17 19 3 5 18 16 12 20 9 6 7 4 2 13