일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 컴퓨터의 구조
- 운영체제
- Protocol
- Regular Expression
- 109. Convert Sorted List to Binary Search Tree
- Python Code
- data science
- 43. Multiply Strings
- 30. Substring with Concatenation of All Words
- 프로그래머스
- Generator
- 315. Count of Smaller Numbers After Self
- concurrency
- t1
- Python
- iterator
- DWG
- LeetCode
- Python Implementation
- Class
- 밴픽
- Substring with Concatenation of All Words
- attribute
- 시바견
- shiba
- kaggle
- Convert Sorted List to Binary Search Tree
- Decorator
- 715. Range Module
- 파이썬
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