Concept Flow - Union Find Disjoint Set Data Structure
Initialize each element as its own set
Find operation: Find root of element
Union operation: Merge two sets
Update parent pointers
Repeat for queries
Check if two elements are in same set
Start with each element alone. Use Find to get root parent. Use Union to join sets by updating parents. Repeat to manage groups.
