method
Backtracking — animated LeetCode walkthroughs
LeetCode problems solved with Backtracking. Browse the complete tag, then watch the algorithm move — step-by-step animation, Python and Go.
114 problems · 94 animated · 20 locked
Full Backtracking index
- 17Letter Combinations of a Phone NumberWatch
- 22Generate ParenthesesWatch
- 37Sudoku SolverWatch
- 39Combination SumWatch
- 40Combination Sum IIWatch
- 46PermutationsWatch
- 47Permutations IIWatch
- 51N-QueensWatch
- 52N-Queens IIWatch
- 77CombinationsWatch
- 78SubsetsWatch
- 79Word SearchWatch
- 89Gray CodeWatch
- 90Subsets IIWatch
- 93Restore IP AddressesWatch
- 95Unique Binary Search Trees IIWatch
- 113Path Sum IIWatch
- 126Word Ladder IIWatch
- 131Palindrome PartitioningWatch
- 140Word Break IIWatch
- 212Word Search IIWatch
- 216Combination Sum IIIWatch
- 254Factor CombinationsLocked
- 257Binary Tree PathsWatch
- 267Palindrome Permutation IILocked
- 282Expression Add OperatorsWatch
- 291Word Pattern IILocked
- 294Flip Game IILocked
- 301Remove Invalid ParenthesesWatch
- 306Additive NumberWatch
- 320Generalized AbbreviationLocked
- 351Android Unlock PatternsLocked
- 357Count Numbers with Unique DigitsWatch
- 401Binary WatchWatch
- 411Minimum Unique Word AbbreviationLocked
- 425Word SquaresLocked
- 465Optimal Account BalancingLocked
- 473Matchsticks to SquareWatch
- 489Robot Room CleanerLocked
- 491Non-decreasing SubsequencesWatch
- 494Target SumWatch
- 526Beautiful ArrangementWatch
- 638Shopping OffersWatch
- 67924 GameWatch
- 681Next Closest TimeLocked
- 691Stickers to Spell WordWatch
- 698Partition to K Equal Sum SubsetsWatch
- 756Pyramid Transition MatrixWatch
- 773Sliding PuzzleWatch
- 784Letter Case PermutationWatch
- 797All Paths From Source to TargetWatch
- 816Ambiguous CoordinatesWatch
- 842Split Array into Fibonacci SequenceWatch
- 949Largest Time for Given DigitsWatch
- 967Numbers With Same Consecutive DifferencesWatch
- 980Unique Paths IIIWatch
- 988Smallest String Starting From LeafWatch
- 996Number of Squareful ArraysWatch
- 1066Campus Bikes IILocked
- 1079Letter Tile PossibilitiesWatch
- 1087Brace ExpansionLocked
- 1088Confusing Number IILocked
- 1096Brace Expansion IIWatch
- 1215Stepping NumbersLocked
- 1219Path with Maximum GoldWatch
- 1238Circular Permutation in Binary RepresentationWatch
- 1239Maximum Length of a Concatenated String with Unique CharactersWatch
- 1240Tiling a Rectangle with the Fewest SquaresWatch
- 1255Maximum Score Words Formed by LettersWatch
- 1258Synonymous SentencesLocked
- 1286Iterator for CombinationWatch
- 1307Verbal Arithmetic PuzzleWatch
- 1415The k-th Lexicographical String of All Happy Strings of Length nWatch
- 1467Probability of a Two Boxes Having The Same Number of Distinct BallsWatch
- 1593Split a String Into the Max Number of Unique SubstringsWatch
- 1601Maximum Number of Achievable Transfer RequestsWatch
- 1655Distribute Repeating IntegersWatch
- 1718Construct the Lexicographically Largest Valid SequenceWatch
- 1723Find Minimum Time to Finish All JobsWatch
- 1774Closest Dessert CostWatch
- 1799Maximize Score After N OperationsWatch
- 1849Splitting a String Into Descending Consecutive ValuesWatch
- 1863Sum of All Subset XOR TotalsWatch
- 1947Maximum Compatibility Score SumWatch
- 1980Find Unique Binary StringWatch
- 1986Minimum Number of Work Sessions to Finish the TasksWatch
- 2002Maximum Product of the Length of Two Palindromic SubsequencesWatch
- 2014Longest Subsequence Repeated k TimesWatch
- 2044Count Number of Maximum Bitwise-OR SubsetsWatch
- 2048Next Greater Numerically Balanced NumberWatch
- 2056Number of Valid Move Combinations On ChessboardWatch
- 2065Maximum Path Quality of a GraphWatch
- 2151Maximum Good People Based on StatementsWatch
- 2152Minimum Number of Lines to Cover PointsLocked
- 2178Maximum Split of Positive Even IntegersWatch
- 2212Maximum Points in an Archery CompetitionWatch
- 2305Fair Distribution of CookiesWatch
- 2375Construct Smallest Number From DI StringWatch
- 2397Maximum Rows Covered by ColumnsWatch
- 2597The Number of Beautiful SubsetsWatch
- 2664The Knight’s TourLocked
- 2698Find the Punishment Number of an IntegerWatch
- 2708Maximum Strength of a GroupWatch
- 2767Partition String Into Minimum Beautiful SubstringsWatch
- 2850Minimum Moves to Spread Stones Over GridWatch
- 2992Number of Self-Divisible PermutationsLocked
- 3211Generate Binary Strings Without Adjacent ZerosWatch
- 3348Smallest Divisible Digit Product IIWatch
- 3376Minimum Time to Break Locks IWatch
- 3437Permutations IIILocked
- 3646Next Special Palindrome NumberWatch
- 3669Balanced K-Factor DecompositionWatch
- 3799Word Squares IIWatch
- 3955Valid Binary Strings With Cost LimitWatch