Pregunta de entrevista de PayPal

disjoint set union type question