본문 바로가기

IT/코딩테스트

[Leetcode] 88. Merge Sorted Array

728x90

https://leetcode.com/problems/merge-sorted-array/

class Solution:
    def merge(self, nums1: List[int], m: int, nums2: List[int], n: int) -> None:
        for i in range(n):
            nums1.pop()
        nums1.extend(nums2)
        nums1.sort()
728x90

'IT > 코딩테스트' 카테고리의 다른 글

[Leetcode] 2843. Count Symmetric Integers  (0) 2023.09.03
[Leetcode] 1051. Height Checker  (0) 2023.09.02
[Leetcode] 1089. Duplicate Zeros  (0) 2023.09.02
[Leetcode] 577. Employee Bonus  (0) 2023.09.01
[Leetcode] 197. Rising Temperature  (0) 2023.08.31