Union Find Pattern

Disjoint sets for connectivity and component merging.

#Title
200Number of Islands
305Number of Islands II
323Number of Connected Components in an Undirected Graph
399Evaluate Division
547Friend Circles
684Redundant Connection
685Redundant Connection II
721Accounts Merge
737Sentence Similarity II
778Swim in Rising Water
803Bricks Falling When Hit
839Similar String Groups
924Minimize Malware Spread
928Minimize Malware Spread II
947Most Stones Removed with Same Row or Column
952Largest Component Size by Common Factor
959Regions Cut By Slashes
990Satisfiability of Equality Equations
1061Lexicographically Smallest Equivalent String
1101The Earliest Moment When Everyone Become Friends
1135Connecting Cities With Minimum Cost
1168Optimize Water Distribution in a Village
1202Smallest String With Swaps
1258Synonymous Sentences
1559Detect Cycles in 2D Grid
1579Remove Max Number of Edges to Keep Graph Fully Traversable
1584Min Cost to Connect All Points
1627Graph Connectivity With Threshold
1631Path With Minimum Effort
1632Rank Transform of a Matrix
1697Checking Existence of Edge Length Limited Paths
1722Minimize Hamming Distance After Swap Operations
1970Last Day Where You Can Still Cross
1998GCD Sort of an Array
2076Process Restricted Friend Requests
2092Find All People With Secret
2157Groups of Strings
2307Check for Contradictions in Equations
2382Maximum Segment Sum After Removals
2421Number of Good Paths
2612Minimum Reverse Operations
2617Minimum Number of Visited Cells in a Grid
2812Find the Safest Path in a Grid
2867Count Valid Paths in a Tree
3108Minimum Cost Walk in Weighted Graph
3235Check if the Rectangle Corner Is Reachable
3378Count Connected Components in LCM Graph
3493Properties Graph
3600Maximize Spanning Tree Stability with Upgrades
3608Minimum Time for K Connected Components
3613Minimize Maximum Component Cost
3710Maximum Partition Factor
3873Maximum Points Activated with One Addition
3887Incremental Even-Weighted Cycle Queries