1. Code

class Solution:
    def restoreString(self, s: str, indices: List[int]) -> str:
        new_str = [""] * len(indices)
        for i, index in enumerate(indices):
            new_str[index] = s[i]
        return "".join(new_str)

2. Result

        Runtime : 48 ms(90.10%), Memory usage : 14.2 MB(14.33%)
        (Runtime can be different by a system even if it is a same code.)

Check out the my GitHub repo for more info on the code. If you have questions, you can leave a reply on this post.