Uber Interview Question

1.Related to union-find data structure difficult