Leetcode: Shuffle String
Problem:
https://leetcode.com/problems/shuffle-string/
Code:
class Solution:
def restoreString(self, s: str, indices: List[int]) -> str:
result=['']*len(s)
for i, index in enumerate(indices):
result[index] = s[i]
...
is-power-of-two.hashnode.dev1 min read