top of page

Code Challenge #9

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.

Code Challenge

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

Rated 0 out of 5 stars.
No ratings yet

Commenting on this post isn't available anymore. Contact the site owner for more info.

Subscribe to get exclusive updates

Thanks for subscribing!

CONTACT ME
avatar-formal-round.png

Follow

  • Medium
  • Facebook
  • Twitter
  • LinkedIn
  • Instagram
  • Youtube
  • linktree
  • Buy Me A Coffee

© 2019 - 2024 By Biyi Akinpelu. The LORD Is My Banner

bottom of page