Cody

Solution 995375

Submitted on 5 Oct 2016 by Massimo Zanetti
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'), 'diff')),'use diff')

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