class Solution {
    public int[] buildArray(int[] nums) {
        int size = nums.length;
        int[] arr = new int[size];
        for (int i = 0; i < size; i++) {
            arr[i] = nums[nums[i]];
        }
        return arr;
    }
}
//runtime:1 ms
//memory:39.2 MB
