面试场景
高频考察问题建模、边界条件与口头表达的清晰度。
常见误区
只背模板不解释为什么,容易在追问里失分。
练习策略
每轮练 3-5 题,固定复盘复杂度和可替代解法。
推荐练习顺序
题库
并查集 题库
先展示一段最适合快速浏览的题目列表,继续滚动时再慢慢续载,避免专题页被长列表一下子拉穿。
慢加载专题题库
适合这类题很多的专题,先扫结构,再逐步深入。
当前展示 24 / 74 道题目
每次续载 24 题最长连续序列
Find the length of the longest consecutive elements sequence in an unsorted array using array scanning and hash lookup.
被围绕的区域
Transform the matrix in-place by marking regions surrounded by 'X' as 'X', while keeping border-adjacent 'O's intact.
岛屿数量
Count the number of distinct islands in a binary grid using array traversal combined with depth-first search exploration…
除法求值
Compute the results of division queries from given equations using graph traversal and depth-first search efficiently.
省份数量
Solve Number of Provinces by scanning the adjacency matrix and launching DFS once per unvisited city component.
冗余连接
Identify and remove the redundant edge that causes a cycle in a graph starting as a tree.
冗余连接 II
Find and remove the redundant connection in a directed graph that was originally a rooted tree.
岛屿的最大面积
Find the largest connected land area in a binary grid using array traversal and depth-first search efficiently.
账户合并
Merge accounts by connecting emails and returning each user's sorted email list using array scanning and hash lookup eff…
情侣牵手
This problem requires arranging couples sitting apart in a row with the minimum number of swaps using graph traversal an…
水位上升的泳池中游泳
Solve the problem of swimming through a grid of rising water with a binary search on the valid answer space.
判断二分图
Determine whether an undirected graph can be split into two independent sets using DFS, BFS, or Union Find patterns.
打砖块
Bricks Falling When Hit challenges your ability to simulate brick falls after sequential erasures using Union Find.
最大人工岛
Calculate the largest island size by converting at most one zero in a binary grid using array and DFS techniques efficie…
相似字符串组
Determine the number of connected groups of similar strings by swapping at most two letters using array scanning and has…
可能的二分法
Determine if a group of n people with mutual dislikes can be split into two non-conflicting groups using graph traversal…
尽量减少恶意软件的传播
Identify which single infected node to remove to minimize total malware spread in a connected network graph efficiently.
尽量减少恶意软件的传播 II
Minimize Malware Spread II asks to minimize the spread of malware in a network of nodes by removing one infected node.
移除最多的同行或同列石头
Maximize the number of stones removed from a 2D plane using graph traversal and DFS.
按公因数计算最大组件大小
Find the largest connected component in an array where edges exist between numbers sharing a common factor greater than …
由斜杠划分区域
Determine the number of regions in a grid divided by slashes using array scanning and union-find techniques efficiently.
等式方程的可满足性
Determine if it's possible to assign values to variables such that all equations are satisfied based on equality and ine…
飞地的数量
This problem involves finding the number of land cells that cannot reach the boundary in a grid using DFS and array mani…
按字典序排列最小的等效字符串
Determine the lexicographically smallest string by modeling character equivalences with union find efficiently.
swap_vert在题库框内继续向下滚动,也会自动续载