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