12345678910 |
- class Solution:
- def createTargetArray(self, nums, index):
- result = []
- for x in range(len(nums)):
- result.insert(index[x], nums[x])
- return result
-
- s = Solution()
- print("Expected: [0, 4, 1, 3, 2]")
- print("Got:", s.createTargetArray([0, 1, 2, 3, 4], [0, 1, 2, 2, 1]))
|