Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1334. Find the City With the Smallest Number of Neighbors at a Threshold Distance
Given a weighted undirected graph of n cities, compute for each city how many other cities are reachable within a given distanceThreshold via shortest paths, and return the city with the smallest such count (breaking ties by largest index). This is essentially an all-pairs shortest-path/counting problem on a small graph (n ≤ 100).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.