Skip to content
Use code for 50% offSee plans

Union Find Problems

74 Union Find LeetCode problems · Solve with AI-powered hints & step-by-step explanations.

Learn the coding interview patterns behind these problems, including Union Find interview patterns.

Start with these

All Union Find problems

128 Longest Consecutive Sequence Medium130 Surrounded Regions Medium200 Number of Islands Medium399 Evaluate Division Medium547 Number of Provinces Medium684 Redundant Connection Medium685 Redundant Connection II Hard695 Max Area of Island Medium721 Accounts Merge Medium765 Couples Holding Hands Hard778 Swim in Rising Water Hard785 Is Graph Bipartite? Medium803 Bricks Falling When Hit Hard827 Making A Large Island Hard839 Similar String Groups Hard886 Possible Bipartition Medium924 Minimize Malware Spread Hard928 Minimize Malware Spread II Hard947 Most Stones Removed with Same Row or Column Medium952 Largest Component Size by Common Factor Hard959 Regions Cut By Slashes Medium990 Satisfiability of Equality Equations Medium1020 Number of Enclaves Medium1061 Lexicographically Smallest Equivalent String Medium1202 Smallest String With Swaps Medium1254 Number of Closed Islands Medium1267 Count Servers that Communicate Medium1319 Number of Operations to Make Network Connected Medium1361 Validate Binary Tree Nodes Medium1391 Check if There is a Valid Path in a Grid Medium1489 Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree Hard1559 Detect Cycles in 2D Grid Medium1569 Number of Ways to Reorder Array to Get Same BST Hard1579 Remove Max Number of Edges to Keep Graph Fully Traversable Hard1584 Min Cost to Connect All Points Medium1627 Graph Connectivity With Threshold Hard1631 Path With Minimum Effort Medium1632 Rank Transform of a Matrix Hard1697 Checking Existence of Edge Length Limited Paths Hard1722 Minimize Hamming Distance After Swap Operations Medium1905 Count Sub Islands Medium1970 Last Day Where You Can Still Cross Hard1971 Find if Path Exists in Graph Easy1998 GCD Sort of an Array Hard2003 Smallest Missing Genetic Value in Each Subtree Hard2076 Process Restricted Friend Requests Hard2092 Find All People With Secret Hard2157 Groups of Strings Hard2316 Count Unreachable Pairs of Nodes in an Undirected Graph Medium2334 Subarray With Elements Greater Than Varying Threshold Hard2368 Reachable Nodes With Restrictions Medium2382 Maximum Segment Sum After Removals Hard2421 Number of Good Paths Hard2424 Longest Uploaded Prefix Medium2492 Minimum Score of a Path Between Two Cities Medium2493 Divide Nodes Into the Maximum Number of Groups Hard2503 Maximum Number of Points From Grid Queries Hard2573 Find the String with LCP Hard2617 Minimum Number of Visited Cells in a Grid Hard2658 Maximum Number of Fish in a Grid Medium2685 Count the Number of Complete Components Medium2709 Greatest Common Divisor Traversal Hard2812 Find the Safest Path in a Grid Medium2948 Make Lexicographically Smallest Array by Swapping Elements Medium3108 Minimum Cost Walk in Weighted Graph Hard3235 Check if the Rectangle Corner Is Reachable Hard3378 Count Connected Components in LCM Graph Hard3493 Properties Graph Medium3532 Path Existence Queries in a Graph I Medium3600 Maximize Spanning Tree Stability with Upgrades Hard3607 Power Grid Maintenance Medium3608 Minimum Time for K Connected Components Medium3613 Minimize Maximum Component Cost Medium3619 Count Islands With Total Value Divisible by K Medium