Cody

Problem 42920. Find the inverse permutation

Solution 1692833

Submitted on 14 Dec 2018
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   Fail
for permlength = 1:100 perm = randperm(permlength); invPerm = inversePermutation(perm); assert(isequal(perm(invPerm),1:permlength)) end

invPerm = 1 invPerm = 1 2

Assertion failed.

Suggested Problems