If I have an array of objects that I have to reorder according to an array of integers that represent the original position, how would I reorder the array of objects according to the order given by the array of integers? The reordered objects array would logically be a new array.
For example, an array of objects holds [A, B, C, D] and it needs to be rearranged according to an array of integers [2, 1, 0, 3], where the integer 2, for example, refers to object C, which in the objects array is in position 2. In the new order of the objects array, C would be in the first position, because the integer 2 is in the first position in the integers array.