jumbled and a list targets of the same length n. The numbers in targets are a permutation of 0 to n - 1.
The letter at position i of jumbled belongs at position targets[i]. Put every letter in its place and return the resulting string.jumbled='tac', targets=[2, 1, 0] → 'cat'
t moves to position 2, a stays at 1 and c goes to 0, giving "cat".
jumbled='ilkm', targets=[1, 2, 3, 0] → 'milk'
Each of the first three letters moves one place to the right and m goes to the front, giving "milk".
n ≤ 100len(targets) = len(jumbled) = njumbled consists of lowercase English letterstargets[i] < n, and all values are distinctjumbled='tac', targets=[2, 1, 0]
'cat'
Run checks the first 3 tests in your browser. Submit checks all 61 tests on the server, hidden ones included.