leetcode 13341 [LeetCode] 1334. Find the City With the Smallest Number of Neighbors at a Threshold Distance (swift, python) Find the City With the Smallest Number of Neighbors at a Threshold Distance - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 풀이 각 도시에서 distanceThreshold 이하의 거리를 갖고 있는 도시의 개수를 카운트 해야 한다. 즉, '모든 지점에서 다른 모든 지점까지의 최단 경로를 모두 구해야 하는 경우'에 해당한다. 그렇기 때문에 최단 경로 알고리즘에서 플로이드 워셜 알고리즘을 사용해서 풀 수.. 2021. 11. 12. 이전 1 다음