본문 바로가기
python-algorithm

Leetcode 1389. Create Target Array in the Given Order

by 무적김두칠 2021. 7. 16.

1
2
3
4
5
6
class Solution:
    def createTargetArray(self, nums: List[int], index: List[int]) -> List[int]:
        target=[]
        for i in range(len(nums)):
            target.insert(index[i],nums[i])
        return target
cs
반응형

댓글