Indlæser opgaven…
Sometimes you need to build a list with precise insertions instead of simply appending to the end. Given two lists of the same length, nums contains the values and index contains the positions where they should be inserted. Go from left to right, insert nums[i] at position index[i], shift later elements to the right, and return the final list.
[0, 1, 2, 3, 4], [0, 1, 2, 2, 1][0, 4, 1, 3, 2][1, 2, 3, 4, 0], [0, 1, 2, 3, 0][0, 1, 2, 3, 4][1], [0][1]def create_target_array(nums: list[int], index: list[int]) -> list[int]:
Log ind for at se indsendelseshistorik
Log indLog ind for at bruge AI-mentor
Log ind[0,1,2,3,4], [0,1,2,2,1][0,4,1,3,2][1,2,3,4,0], [0,1,2,3,0][0,1,2,3,4][1], [0][1][5,5,5], [0,0,0][5,5,5][1,2,3], [0,0,0][3,2,1][1], [0,0][1]