일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- 시바견
- 프로그래머스
- Protocol
- Python Code
- Regular Expression
- Generator
- kaggle
- 30. Substring with Concatenation of All Words
- shiba
- Python
- 밴픽
- 컴퓨터의 구조
- t1
- attribute
- 운영체제
- 파이썬
- 109. Convert Sorted List to Binary Search Tree
- iterator
- DWG
- Python Implementation
- Decorator
- Class
- 315. Count of Smaller Numbers After Self
- Convert Sorted List to Binary Search Tree
- data science
- concurrency
- Substring with Concatenation of All Words
- 715. Range Module
- 43. Multiply Strings
- LeetCode
Archives
- Today
- Total
목록Merge Sorted Array (1)
Scribbling
LeetCode: 88. Merge Sorted Array
The key here is that we need to push elements from nums2 to nums1 while not disturbing the existing elements in nums1. So, put the elems from nums2 to nums1 from the end. 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. """ p1, p2 = m - 1, n - 1 for i in range(m+n-1, -1, -1): p1_val = nums1[p1]..
Computer Science/Coding Test
2021. 10. 9. 18:10