Problem 1334 · Medium

Find the City With the Smallest Number of Neighbors at a Threshold Distance

Floyd-Warshall: let each city in turn serve as a stepping stone, then count the cities within the threshold of every city.

Open the interactive visualisation