Union Find basics
Union Find keeps groups of nodes apart or together with one array: every node points to a parent, and the root of a tree names its group. Watch find, union and isSame first as they are, then with path compression and union by rank.
In the forest an arrow goes from each node to its parent; rank counts the nodes in each root's tree.