1
2
3
4
5
6
7
8
9
|
class Solution:
def merge(self, nums1: List[int], m: int, nums2: List[int], n: int) -> None:
"""
Do not return anything, modify nums1 in-place instead.
"""
for i in range(len(nums1)-m): nums1.pop()
for i in range(n):
nums1.append(nums2[i])
nums1.sort()
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
Leetcode 1528. Shuffle String (0) | 2021.07.15 |
---|---|
Leetcode 1365. How Many Numbers Are Smaller Than the Current Number (0) | 2021.07.15 |
Leetcode 771. Jewels and Stones (0) | 2021.07.15 |
Leetcode 171. Excel Sheet Column Number (0) | 2021.07.15 |
Leetcode 50. Pow(x, n) (0) | 2021.07.15 |
댓글