1
2
3
4
5
6
7
8
9
|
class Solution:
def restoreString(self, s: str, indices: List[int]) -> str:
tmp=['0']*len(indices)
for i in range(len(indices)):
tmp[indices[i]]=s[i]
ans=''
for i in tmp:
ans+=i
return ans
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
Leetcode 1342. Number of Steps to Reduce a Number to Zero (0) | 2021.07.15 |
---|---|
Leetcode 1281. Subtract the Product and Sum of Digits of an Integer (0) | 2021.07.15 |
Leetcode 1365. How Many Numbers Are Smaller Than the Current Number (0) | 2021.07.15 |
Leetcode 88. Merge Sorted Array (0) | 2021.07.15 |
Leetcode 771. Jewels and Stones (0) | 2021.07.15 |
댓글