SimilarWeb interview question

graph question that requirs "union-find"