일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- Regular Expression
- Decorator
- Substring with Concatenation of All Words
- 715. Range Module
- 프로그래머스
- kaggle
- shiba
- concurrency
- data science
- 컴퓨터의 구조
- DWG
- 315. Count of Smaller Numbers After Self
- Protocol
- 파이썬
- iterator
- Class
- 운영체제
- 109. Convert Sorted List to Binary Search Tree
- 43. Multiply Strings
- attribute
- Generator
- Convert Sorted List to Binary Search Tree
- 30. Substring with Concatenation of All Words
- Python Code
- 시바견
- LeetCode
- t1
- 밴픽
- Python
- Python Implementation
Archives
- Today
- Total
목록218. The Skyline Problem (1)
Scribbling
LeetCode: 218. The Skyline Problem
아래 너튜버분께 매번 배우게 되는 것 같다. https://www.youtube.com/watch?v=GSBLe8cKu0s&t=3s 아래는 위의 영상에 나온 알고리즘의 파이썬 코드이다. from functools import cmp_to_key import heapq class Solution: def getSkyline(self, buildings: List[List[int]]) -> List[List[int]]: # [loc, height, isEnd] points = [] for l, r, h in buildings: points.append([l, h, 0]) points.append([r, h, 1]) def compare(p1, p2): if p1[0] != p2[0]: return p1[0]..
Computer Science/Coding Test
2021. 12. 22. 19:19