Create Target Array

Easy
Arrays Array

Given nums[] and index[], insert nums[i] at index[i]. Print result.

Constraints

1 ≤ len ≤ 100

Examples

Example 1:
Input: 0 1 2 3 4 0 1 2 2 1
Output: 0 4 1 3 2
Example 2:
Input: 1 2 3 4 0 0 1 2 3 0
Output: 0 1 2 3 4
▲ Console

Install Talent Arabia

Get instant access to jobs and career tools on your device.