Problem 1568 · Hard

Minimum Number of Days to Disconnect Island

Find the cut cells of the island with a DFS that tracks discovery and low times; a cut cell disconnects it in one day, and otherwise two days always suffice.

Open the interactive visualisation