введите здесь описание изображения
Код: Выделить всё
class Solution(object):
def merge(self, nums1, m, nums2, n):
"""
:type nums1: List[int]
:type m: int
:type nums2: List[int]
:type n: int
:rtype: None Do not return anything, modify nums1 in-place instead.
"""
for x in range(n):
nums1.remove(0)
nums1 = nums1 + nums2
nums1.sort()
print(nums1)
введите здесь описание изображения
Подробнее здесь: https://stackoverflow.com/questions/791 ... -in-python