DIY: Number of Provinces
Understand how to determine the total number of provinces by analyzing a connectivity matrix of cities. Learn to identify groups of directly or indirectly connected cities and implement algorithms to solve this common graph problem in coding interviews.
We'll cover the following...
We'll cover the following...
Problem statement
Suppose there are n cities, where some are ...