↓Skip to main content

LeetCode

LeetCode 851: Loud and Rich
·2 mins
LeetCode Medium Graph Topological-Sort
LeetCode note for Loud and Rich, rebuilt from the original learning note
LeetCode 802: Find Eventual Safe States
·3 mins
LeetCode Medium Graph Topological-Sort
LeetCode note for Find Eventual Safe States, rebuilt from the original learning note
LeetCode 1203: Sort Items by Groups Respecting Dependencies
·3 mins
LeetCode Hard Graph Topological-Sort
LeetCode note for Sort Items by Groups Respecting Dependencies, rebuilt from the original learning note
LeetCode 3900: Longest Balanced Substring After One Swap
·3 mins
LeetCode Medium Prefix-Sum Hash-Table String
LeetCode 3900 note: equal prefix differences mean balanced; a substring off by 2 also works if a swappable character exists outside, and keeping the two earliest positions per difference is enough
LeetCode 3899: Angles of a Triangle
·2 mins
LeetCode Medium Math Geometry
LeetCode 3899 note: check the triangle inequality first, compute the three angles with the law of cosines, and remember to sort them
LeetCode 3898: Find the Degree of Each Vertex
·1 min
LeetCode Easy Graph Matrix Array
LeetCode 3898 note: the number of ones in row i of the adjacency matrix is vertex i’s degree
LeetCode 310: Minimum Height Trees
·3 mins
LeetCode Medium Graph Topological-Sort
LeetCode note for Minimum Height Trees, rebuilt from the original learning note
LeetCode 2115: Find All Possible Recipes from Given Supplies
·3 mins
LeetCode Medium Graph Topological-Sort
LeetCode note for Find All Possible Recipes from Given Supplies, rebuilt from the original learning note
LeetCode 2192: All Ancestors of a Node in a DAG
·3 mins
LeetCode Medium Graph Topological-Sort
LeetCode note for All Ancestors of a Node in a DAG, rebuilt from the original learning note
LeetCode 210: Course Schedule II
·2 mins
LeetCode Medium Graph Topological-Sort
LeetCode note for Course Schedule II, rebuilt from the original learning note
LeetCode 207: Course Schedule
·2 mins
LeetCode Medium Graph Topological-Sort
LeetCode note for Course Schedule, rebuilt from the original learning note
LeetCode 1971: Find if Path Exists in Graph
·2 mins
LeetCode Easy Graph Union-Find
LeetCode note for Find if Path Exists in Graph, rebuilt from the original learning note