🚀 NeetCode 973 Algorithm HandbookBlind 75 · NC 150 · NC 25019 Core Categories

NeetCode Comprehensive Algorithm Bank & Offline Handbook

Synchronized bilingual toggle with dual NeetCode & LeetCode problem numbering and direct links. Features step-by-step logic, benchmark Python3 code, complexity analysis, interview pitfalls, and standalone offline exports.

Mastery Progress
0.0%(0/973)
● Mastered: 0
◐ Reviewing: 0
○ Unstarted: 973
🔍
🎯 Featured Lists
📂 Categories (19 Core Topics)
Diff:
Mastery:
Showing 24 problems
NeetCode #577LC-261GraphsBlind 75NC 150NC 250
Medium

Graph Valid Tree (以图判树)

You are given n nodes labelled 0..n-1 and a list of undirected edges. Return whether the edges form a valid tree. Constraints: 1 &...

View Solution→
NeetCode #578LC-1462GraphsNC 250
Medium

Course Schedule IV (课程表 IV)

There are numCourses courses. Given prerequisites and queries where queries[i] = [a, b], return a boolean array where the i-th ent...

View Solution→
NeetCode #579LC-1958Graphs
Medium

Check if Move is Legal (检查操作是否合法)

You are given an 8x8 board with 'W', 'B' and '.', and a move at (rMove, cMove) with color. The move is legal if it forms a bracket...

View Solution→
NeetCode #580LC-934Graphs
Medium

Shortest Bridge (最短的桥)

You are given an n x n binary grid with exactly two islands. Return the shortest bridge length: the minimum number of 0s that must...

View Solution→
NeetCode #581LC-1091Graphs
Medium

Shortest Path in Binary Matrix (二进制矩阵中的最短路径)

Given an n x n binary matrix grid, return the length of the shortest clear path from the top-left to the bottom-right, where all c...

View Solution→
NeetCode #582LC-323GraphsBlind 75NC 150NC 250NC Algo100
Medium

Number of Connected Components in an Undirected Graph (无向图中连通分量的数目)

You are given n nodes labelled 0..n-1 and a list of undirected edges. Return the number of connected components. Constraints: 1 &l...

View Solution→
NeetCode #583LC-684GraphsNC 150NC 250
Medium

Redundant Connection (冗余连接)

In a graph that started as a tree with n nodes and one extra edge was added, given the edges list, return the extra edge. If there...

View Solution→
NeetCode #584LC-721GraphsNC 250
Medium

Accounts Merge (账户合并)

Given a list of accounts where accounts[i] = [name, email1, email2, ...], merge accounts that share any email. Two accounts belong...

View Solution→
NeetCode #585LC-2359Graphs
Medium

Find Closest Node to Given Two Nodes (找到离给定两个节点最近的节点)

You are given a directed graph where edges[i] is the single outgoing edge from node i (-1 means none), and two starting nodes node...

View Solution→
NeetCode #586LC-1162Graphs
Medium

As Far from Land as Possible (地图分析)

Given an n x n grid containing only 0 (water) and 1 (land), return the maximum Manhattan distance from a water cell to its nearest...

View Solution→
NeetCode #587LC-1129Graphs
Medium

Shortest Path with Alternating Colors (颜色交替的最短路径)

You are given a directed graph with red edges and blue edges. Return the shortest path length from node 0 to each node such that t...

View Solution→
NeetCode #588LC-2477Graphs
Medium

Minimum Fuel Cost to Report to the Capital (到达首都的最少油耗)

There is a tree of n cities with city 0 as the capital. roads[i] = [a, b] is an undirected road. Each city has one representative,...

View Solution→
NeetCode #589LC-2492Graphs
Medium

Minimum Score of a Path Between Two Cities (两个城市间路径的最小分数)

You are given n cities and roads[i] = [a, b, distance]. A path's score is its minimum road distance. Return the minimum possible s...

View Solution→
NeetCode #590LC-1254Graphs
Medium

Number of Closed Islands (统计封闭岛屿的数目)

Given an m x n binary matrix grid, return the number of closed islands: maximal 4-directionally connected groups of 0s completely ...

View Solution→
NeetCode #591LC-1020Graphs
Medium

Number of Enclaves (飞地的数量)

Given an m x n binary matrix grid where 0 is sea and 1 is land, return the number of land cells from which you cannot walk off the...

View Solution→
NeetCode #592LC-547Graphs
Medium

Number of Provinces (省份数量)

There are n cities, some connected. Given an n x n adjacency matrix isConnected, return the number of provinces (connected compone...

View Solution→
NeetCode #593LC-959Graphs
Medium

Regions Cut By Slashes (由斜杠划分区域)

An n x n grid of /, \ and represents a picture divided into regions by the slashes. Return the number of regions. Constraints: 1...

View Solution→
NeetCode #594LC-1557Graphs
Medium

Minimum Number of Vertices to Reach All Nodes (可以到达所有点的最少点数目)

Given a DAG with n vertices and edges, return the smallest set of vertices from which all other vertices are reachable. Constraint...

View Solution→
NeetCode #595LC-785Graphs
Medium

Is Graph Bipartite? (判断二分图)

There is an undirected graph with n nodes where graph[i] lists the neighbours of node i. Return whether the graph is bipartite: th...

View Solution→
NeetCode #596LC-2685Graphs
Medium

Count the Number of Complete Components (统计完全连通分量的数量)

You are given an undirected graph with n vertices and edges. A connected component is complete if every pair of its vertices has a...

View Solution→
NeetCode #597LC-399GraphsNC 250
Medium

Evaluate Division (除法求值)

You are given equations where equations[i] = [Ai, Bi] and values[i] means Ai / Bi = values[i]. Given queries, return the answer to...

View Solution→
NeetCode #598LC-2101Graphs
Medium

Detonate the Maximum Bombs (引爆最多的炸弹)

Given an m x n grid of characters, return whether there is a cycle of length 4 or more: four or more cells of the same value conne...

View Solution→
NeetCode #599LC-2115Graphs
Medium

Find All Possible Recipes from Given Supplies (从给定原材料中找到所有可以做出的菜)

You are given recipes, ingredients (parallel arrays) and supplies (initially available items). A recipe can be made when all its i...

View Solution→
NeetCode #600LC-3243Graphs
Medium

Shortest Distance After Road Addition Queries I (新增道路查询后的最短距离 I)

There are n cities numbered 0..n-1 with a directed road from i to i+1 for each i. For each query [u, v], add a road u -> v and ...

View Solution→