일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- Decorator
- 프로그래머스
- shiba
- Generator
- kaggle
- 30. Substring with Concatenation of All Words
- Python Code
- Convert Sorted List to Binary Search Tree
- LeetCode
- DWG
- concurrency
- 시바견
- Substring with Concatenation of All Words
- data science
- Python Implementation
- Class
- Regular Expression
- t1
- Python
- 파이썬
- 컴퓨터의 구조
- 109. Convert Sorted List to Binary Search Tree
- 운영체제
- iterator
- 715. Range Module
- attribute
- 315. Count of Smaller Numbers After Self
- 밴픽
- 43. Multiply Strings
Archives
- Today
- Total
목록Course Schedule II (1)
Scribbling
LeetCode: 210. Course Schedule II
위상 정렬 문제다. result의 길이를 통해 위상 정렬 성공 여부를 파악 가능하다. class Solution: def findOrder(self, numCourses: int, prerequisites: List[List[int]]) -> List[int]: indegrees = [0] * numCourses graph = [[] for _ in range(numCourses)] for v, u in prerequisites: graph[u].append(v) indegrees[v] += 1 ret = [] q = [] for node, indegree in enumerate(indegrees): if indegree == 0: q.append(node) while q: u = q.pop() ret...
Computer Science/Coding Test
2021. 12. 7. 20:56