Code Challenge #9
- Biyi Akinpelu
- Nov 10, 2023
- 1 min read
Updated: Nov 29, 2023
A permutation can be specified by an array P, where P[i] represents the location of the element at i in the permutation.

For example, [2, 1, 0] represents the permutation where elements at the index 0 and 2 are swapped.
Given an array and a permutation, apply the permutation to the array. For example, given the array ["a", "b", "c"] and the permutation [2, 1, 0], return ["c", "b", "a"].
Head over to this link to solve the problem.
Comments