Solution 1 - Direct Placement
Place each character at its target index and join.
""" 1528.1 - Shuffle String - Solution 1 - Direct Placement """
from typing import List
class Solution:
def restoreString(self, s: str, indices: List[int]) -> str:
out = [""] * len(s)
for i, ch in enumerate(s):
out[indices[i]] = ch
return "".join(out)