面试场景
高频考察问题建模、边界条件与口头表达的清晰度。
常见误区
只背模板不解释为什么,容易在追问里失分。
练习策略
每轮练 3-5 题,固定复盘复杂度和可替代解法。
推荐练习顺序
除法求值
Compute the results of division queries from given equations using graph traversal and depth-first search efficiently.
网络延迟时间
Find the minimum time for a signal to travel to all nodes in a directed graph or determine if it's impossible.
K 站中转内最便宜的航班
Find the cheapest flight from a source to a destination with at most K stops using graph traversal techniques efficientl…
细分图中的可到达节点
The Reachable Nodes In Subdivided Graph problem requires efficiently finding the reachable nodes using graph traversal a…
阈值距离内邻居最少的城市
Find the city with the fewest neighbors within a given threshold distance using dynamic programming.
使网格图至少有一条有效路径的最小代价
Determine the minimum cost to create at least one valid path from the top-left to bottom-right in a directional grid.
概率最大的路径
Find the path with the highest success probability in a graph from a start node to an end node, using edge probabilities…
从第一个节点出发到最后一个节点的受限路径数
Solve the problem of finding the number of restricted paths in a weighted undirected graph, leveraging graph algorithms …
到达目的地的方案数
Find the number of ways to travel from intersection 0 to n - 1 in the shortest time, using a graph-based approach.
到达目的地的第二短时间
Find the second minimum time to reach a destination using BFS while accounting for traffic signal delays in a graph trav…
包含要求路径的最小带权子图
Find the minimum weighted subgraph that connects three specified nodes in a directed graph with constraints.
到达角落需要移除障碍物的最小数目
Find the minimum obstacles to remove in a 2D grid to reach the bottom-right corner using BFS graph traversal techniques.
在网格图中访问一个格子的最少时间
Compute the fastest path in a grid where each cell has a minimum time requirement using BFS and priority queue technique…
设计可以求最短路径的图类
Implement a dynamic weighted directed graph with efficient shortest path queries and edge additions in real time.
前往目标的最小代价
Find the minimum cost path between two points, using special roads or direct moves in a 2D space.
修改图中的边权
Modify Graph Edge Weights is a graph problem where you adjust edge weights to match a target shortest path distance.
关闭分部的可行集合数目
Calculate all valid sets of branch closures while keeping remaining branches within maxDistance using bitmask and graph …
转换字符串的最小成本 I
This problem asks to calculate the minimum cost to convert a string from source to target using specific character trans…
转换字符串的最小成本 II
Compute the minimum cost to transform source into target using substring replacements with given costs efficiently using…
访问消失节点的最少时间
Determine the minimum time to visit each node in a disappearing-node graph using arrays, graphs, and priority queues eff…
最短路径中的边
Use two Dijkstra runs to mark exactly which edges can appear on at least one shortest path from 0 to n - 1.
穿越网格图的安全路径
Determine if you can safely traverse a binary grid from top-left to bottom-right using limited health points.
到达最后一个房间的最少时间 I
Find Minimum Time to Reach Last Room I challenges you to determine the minimum time to travel in a dungeon with a grid l…
到达最后一个房间的最少时间 II
Calculate the minimum time to reach the last room in a grid with alternating move times using array and graph patterns.
使两个整数相等的数位操作
Transform n into m using allowed digit operations without creating primes, applying math and graph strategies efficientl…
图的最大边权的最小值
Minimize the maximum edge weight in a graph after removing certain edges while ensuring node reachability.
所有人渡河所需的最短时间
Find the minimum time to transport individuals across a river with dynamic environmental conditions and boat capacity.
有向图中到达终点的最少时间
The problem involves finding the minimum time to reach the destination in a directed graph with time-dependent edges.
恢复网络路径
Find the maximum recovery cost of valid paths in a directed acyclic graph where some nodes are offline.