Mental Model
Union Find keeps track of groups of items and quickly tells if two items are in the same group.
Analogy: Imagine groups of friends where each friend knows who their group leader is. When two groups meet, they pick one leader to represent both groups.
0 -> 0 1 -> 1 2 -> 2 3 -> 3 4 -> 4 Each number points to itself as its own leader initially.
