techiedelight.com
Shuffle an array according to the given order of elements - Techie Delight
Given an array of distinct integers, shuffle an array according to the given order of elements. If pos[i] = j, then update arr[j] = arr[i] for every index i.