일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- iterator
- kaggle
- 운영체제
- 109. Convert Sorted List to Binary Search Tree
- Python Implementation
- 715. Range Module
- Decorator
- LeetCode
- 315. Count of Smaller Numbers After Self
- Protocol
- Class
- 밴픽
- 컴퓨터의 구조
- Python Code
- Convert Sorted List to Binary Search Tree
- concurrency
- t1
- Substring with Concatenation of All Words
- Generator
- DWG
- Python
- attribute
- 프로그래머스
- 파이썬
- Regular Expression
- 시바견
- data science
- 43. Multiply Strings
- shiba
- 30. Substring with Concatenation of All Words
Archives
- Today
- Total
목록57. Insert Interval (1)
Scribbling
LeetCode: 57. Insert Interval
class Solution: def insert(self, intervals: List[List[int]], newInterval: List[int]) -> List[List[int]]: ret = [] i = 0 for i, interval in enumerate(intervals): if interval[0] = newInterval[0]: ret[-1][1] = max(ret[-1][1], newInterval[1]) else: ret.append(newInterval) for j in range(i, len(intervals)): interval = intervals[j] if ret and ret[-1][1] >= interval[0]: ret[-1][1] = max(ret[-1][1], int..
Computer Science/Coding Test
2021. 9. 24. 09:58