method
Topological Sort — animated LeetCode walkthroughs
LeetCode problems solved with Topological Sort. Browse the complete tag, then watch the algorithm move — step-by-step animation, Python and Go.
40 problems · 30 animated · 10 locked
Full Topo sort index
- 207Course ScheduleWatch
- 210Course Schedule IIWatch
- 269Alien DictionaryLocked
- 310Minimum Height TreesWatch
- 329Longest Increasing Path in a MatrixWatch
- 444Sequence ReconstructionLocked
- 631Design Excel Sum FormulaLocked
- 802Find Eventual Safe StatesWatch
- 851Loud and RichWatch
- 913Cat and MouseWatch
- 1059All Paths from Source Lead to DestinationLocked
- 1136Parallel CoursesLocked
- 1203Sort Items by Groups Respecting DependenciesWatch
- 1245Tree DiameterLocked
- 1462Course Schedule IVWatch
- 1591Strange Printer IIWatch
- 1632Rank Transform of a MatrixWatch
- 1728Cat and Mouse IIWatch
- 1786Number of Restricted Paths From First to Last NodeWatch
- 1857Largest Color Value in a Directed GraphWatch
- 1916Count Ways to Build Rooms in an Ant ColonyWatch
- 1976Number of Ways to Arrive at DestinationWatch
- 2050Parallel Courses IIIWatch
- 2115Find All Possible Recipes from Given SuppliesWatch
- 2127Maximum Employees to Be Invited to a MeetingWatch
- 2192All Ancestors of a Node in a Directed Acyclic GraphWatch
- 2204Distance to a Cycle in Undirected GraphLocked
- 2246Longest Path With Different Adjacent CharactersWatch
- 2328Number of Increasing Paths in a GridWatch
- 2360Longest Cycle in a GraphWatch
- 2371Minimize Maximum Value in a GridLocked
- 2392Build a Matrix With ConditionsWatch
- 2603Collect Coins in a TreeWatch
- 2876Count Visited Nodes in a Directed GraphWatch
- 3383Minimum Runes to Add to Cast SpellLocked
- 3435Frequencies of Shortest SupersequencesWatch
- 3481Apply SubstitutionsLocked
- 3530Maximum Profit from Valid Topological Order in DAGWatch
- 3620Network Recovery PathwaysWatch
- 3812Minimum Edge Toggles on a TreeWatch