#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
vector<int> createTargetArray(vector<int>& nums, vector<int>& index) {
vector<int> res(nums.size());
for(int i = 0; i < nums.size(); i ++){
for(int j = i - 1; j >= index[i]; j --)
res[j + 1] = res[j];
res[index[i]] = nums[i];
}
return res;
}
};
int main() {
return 0;
}
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
vector<int> createTargetArray(vector<int>& nums, vector<int>& index) {
vector<int> res;
for(int i = 0; i < nums.size(); i ++)
res.insert(res.begin() + index[i], nums[i]);
return res;
}
};
int main() {
return 0;
}