Cody

Problem 42920. Find the inverse permutation

Solution 2042152

Submitted on 2 Dec 2019 by cokakola
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 permlength = 1:100 perm = randperm(permlength); invPerm = inversePermutation(perm); assert(isequal(perm(invPerm),1:permlength)) end

Suggested Problems

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!