Cody

# Problem 43036. Non trivial identities - flipping

Solution 1688164

Submitted on 7 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'), 'flip')),'use flip')

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