DSU Introductory Problem - Advanced Data Structures / Disjoint Set Union | Union Find

https://algo.monster/problems/dsu_problem_intro

Why is time complexity O(nlogn)?