1528. Shuffle String

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 1528

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