Maximum Distance (Codeforces 1081D): explain the approach and write the code in a shared doc within 60 min.
Asked in the Algo Round I stage.
Implement maximum_distance(n, m, special, edges). The undirected graph has vertices 0 through n - 1; each edge is [u, v, weight]. Return the smallest possible maximum edge weight on a connected subgraph containing every vertex in special. Return that value once for each special vertex, in any order.
def maximum_distance(n, m, special, edges):