Block Interview Question

Related to graph theory