Microsoft Interview Question

Disjoint set union strivers question