Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- leetcode풀기
- python priority queue
- python xor
- 잇츠디모
- 코틀린기초
- 릿코드 파이썬
- python 알고리즘
- python sorted
- 파이썬릿코드풀기
- LeetCode
- 파이썬알고리즘풀기
- python Leetcode
- binary search
- 알고리즘풀기
- leetcode 풀기
- 파이썬릿코드
- 파이썬 알고리즘 풀기
- 릿코드풀기
- python zip_longest
- 상가수익률계산기
- 릿코드풀이
- python 릿코드
- 알고리즘풀이
- 릿코드
- 파이썬 릿코드
- 파이썬 알고리즘
- 파이썬 프로그래머스
- leetcode풀이
- 파이썬알고리즘
- 릿코드 풀기
Archives
- Today
- Total
소프트웨어에 대한 모든 것
LeetCode 풀이 - 1528. Shuffle String 본문
반응형
Shuffle String
문제)


솔루션1)
class Solution:
def restoreString(self, s: str, indices: List[int]) -> str:
res = [0] * len(s)
for i1, i2 in enumerate(indices):
res[i2] = s[i1]
return ''.join(res)
솔루션2)
class Solution:
def restoreString(self, s: str, indices: List[int]) -> str:
res = [0] * len(s)
for idx, ch in enumerate(s):
res[indices[idx]] = ch
return ''.join(res)
반응형
'알고리즘 > LeetCode' 카테고리의 다른 글
LeetCode 풀이 - 2006. Count Number of Pairs With Absolute Difference K (0) | 2021.10.19 |
---|---|
LeetCode 풀이 - 1769. Minimum Number of Operations to Move All Balls to Each Box (0) | 2021.10.19 |
LeetCode 풀이 - 1828. Queries on Number of Points Inside a Circle (0) | 2021.10.16 |
LeetCode 풀이 - 1672. Richest Customer Wealth (0) | 2021.10.16 |
LeetCode 풀이 - 1480. Running Sum of 1d Array (0) | 2021.10.16 |