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