getPrivatePosition method

List<int> getPrivatePosition(
  1. List<int> positions,
  2. List<int> privateArray
)

Implementation

List<int> getPrivatePosition(List<int> positions, List<int> privateArray) {
  List<int> privatePosition =
      new List<int>.generate(positions.length, (index) => 0, growable: false);

  for (int k = 0; k < positions.length; k++) {
    int a = positions[k];

    int b = privateArray[a];

    privatePosition[k] = b;
  }

  return privatePosition;
}