Number of Provinces — Union-Find
Count the groups of cities in a road-link table that can reach each other through chains of roads, with each isolated city its own group.
Union-Find · Easy
Count the groups of cities in a road-link table that can reach each other through chains of roads, with each isolated city its own group.
Union-Find · Easy