educative.io

Time complexity of Last Day

If the provided solution isn’t using ranking, can we claim that it has O(α(mn)) union time?

def union(self, v1, v2):
        self.reps[self.find(v1)] = self.find(v2)

Course: Grokking Coding Interview Patterns in Python - AI-Powered Learning for Developers
Lesson: https://www.educative.io/courses/grokking-coding-interview-patterns-python/solution-last-day-where-you-can-still-cross