DIY: Number of Provinces
Solve the interview question "Number of Provinces" in this lesson.
We'll cover the following...
Problem statement
Suppose there are n
cities, where some are connected, while others are not.
If a city c1
is connected to city c2
, and city c2
is ...
Access this course and 1400+ top-rated courses and projects.