Pregunta de entrevista de Amazon

Minimum spanning tree and another graph related problem