Back to problems

Redundant Connection: Underground Pipes

Algorithm · Two Sigma · Medium

Problem Description You are given an undirected graph of cities joined by pipelines. Every pipeline is an endpoint pair [u, v], meaning cities u and v have a pipeline directly connecting them. Inspect the network to identify unnecessary links. A pipeline is redundant when removing it would leave the cities connected. Create a function that returns the earliest redundant pipeline according to its position in the input list. The graph is supplied as an edge list, where each…

Checking your access…