개발공부/algorithm
[Leetcode][python] 1528. Shuffle String
so.py
2021. 7. 4. 21:34
Problem
- Leetcode 1528. Shuffle String
- Level: Easy
- Link
Shuffle String - LeetCode
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
leetcode.com
My Code
class Solution(object):
def restoreString(self, s, indices):
listShuffle = list(s)
for x in range(len(s)):
listShuffle[indices[x]] = s[x]
return ''.join(listShuffle)