1389. Create Target Array in the Given Order

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 1389

class Solution:
    def createTargetArray(self, nums: List[int], index: List[int]) -> List[int]:
        target = []
        for x, i in zip(nums, index):
            target.insert(i, x)
        return target