1528. Shuffle String

Обновлено: 2024-03-12
1 мин
[]

Содержание

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)