Problem 42920. Find the inverse permutation
Given a permutation vector perm (a vector of n elements containing all the elements from 1 to n in some order), return the permutation vector invPerm such that perm(invPerm) is the a list of elements from 1 to n.
Solution Stats
Problem Comments
-
1 Comment
Asif Newaz
on 2 Jun 2025
you should add an example to better explain the question.
For others =>
if, perm = [3, 1, 4, 2]
invPerm = [2, 4, 1, 3] - that is the index of 1 to n.
Solution Comments
Show commentsProblem Recent Solvers69
Suggested Problems
-
Find the longest sequence of 1's in a binary sequence.
6556 Solvers
-
3057 Solvers
-
951 Solvers
-
785 Solvers
-
Find the sides of an isosceles triangle when given its area and height from its base to apex
2074 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!