Leetcode 1528. Shuffle String | | Leetcode 1528. Shuffle String 文章作者:Tyan博客:noahsnail.com | CSDN | 简书 1. Description 2. Solution解析:Version 1,根据要求,按顺序将字母填到对应位置即可。 Version 1 123456class Solution: def restoreString(self, s: str, indices: List[int]) -> str: res = ['0'] * len(s) for index, pos in enumerate(indices): res[pos] = s[index] return ''.join(res) Reference https://leetcode.com/problems/shuffle-string/ 如果有收获,可以请我喝杯咖啡! 赏 微信打赏 支付宝打赏