일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- concurrency
- Convert Sorted List to Binary Search Tree
- 715. Range Module
- Class
- 시바견
- Python Implementation
- 43. Multiply Strings
- Regular Expression
- 30. Substring with Concatenation of All Words
- 운영체제
- kaggle
- shiba
- 컴퓨터의 구조
- t1
- iterator
- 프로그래머스
- 315. Count of Smaller Numbers After Self
- Python
- LeetCode
- Python Code
- Decorator
- attribute
- 109. Convert Sorted List to Binary Search Tree
- 밴픽
- Protocol
- Substring with Concatenation of All Words
- DWG
- Generator
- data science
- 파이썬
Archives
- Today
- Total
목록1334. Find the City With the Smallest Number of Neighbors at a Threshold Distance (1)
Scribbling
LeetCode: 1334. Find the City With the Smallest Number of Neighbors at a Threshold Distance
class Solution: def findTheCity(self, n: int, edges: List[List[int]], distanceThreshold: int) -> int: INF = int(1e9) distance = [[INF] * (n) for _ in range(n)] for i in range(n): distance[i][i] = 0 for edge in edges: u = edge[0] v = edge[1] w = edge[2] distance[u][v] = w distance[v][u] = w for k in range(n): for a in range(n): for b in range(n): distance[a][b] = min(distance[a][b], distance[a][k..
Computer Science/Coding Test
2021. 8. 10. 21:57