Given which cities are directly connected, count the groups of cities that are connected directly or through others.
Given which cities are directly connected, count the groups of cities that are connected directly or through others.
Opens with the full question.