LeetCode 967: Numbers With Same Consecutive Differences
A clear explanation of generating all n-digit numbers whose adjacent digits differ by k.
53 notes
A clear explanation of generating all n-digit numbers whose adjacent digits differ by k.
A clear explanation of the Split Array into Fibonacci Sequence problem using backtracking, leading-zero checks, and 32-bit integer limits.
A clear explanation of counting unique permutations where every adjacent pair sums to a perfect square using backtracking.
A clear explanation of counting all paths from start to end that visit every non-obstacle square exactly once using backtracking.
An enumeration solution for reconstructing all valid coordinate pairs after commas, spaces, and decimal points were removed.
A clear explanation of finding every path from node 0 to node n - 1 in a directed acyclic graph using DFS and backtracking.
A clear explanation of generating all strings formed by independently changing each letter to lowercase or uppercase.
A clear explanation of solving Pyramid Transition Matrix using backtracking and memoization over pyramid rows.
Decide whether an array can be divided into k non-empty subsets with equal sums using backtracking and pruning.
Determine whether four numbers can be combined with arithmetic operations and parentheses to produce 24.
A DFS and memoization solution for finding the minimum cost to satisfy item needs using individual prices and reusable special offers.
A clear explanation of Permutations II using sorting, depth-first search, and duplicate-skipping backtracking.
A clear explanation of Permutations using depth-first search and backtracking.
A clear explanation of counting beautiful arrangements using backtracking and divisibility pruning.
A clear explanation of counting sign assignments that reach a target using recursion first, then subset-sum dynamic programming.
A clear explanation of generating all distinct non-decreasing subsequences using DFS, backtracking, and per-level duplicate control.
A clear explanation of cleaning an unknown grid using DFS, relative coordinates, and physical backtracking.
A clear explanation of solving Zuma Game with DFS, memoization, and chain-removal simulation.
A clear explanation of deciding whether matchsticks can form a square using backtracking, sorting, and pruning.
A clear explanation of minimizing debt-settlement transactions using net balances, backtracking, and memoization-style pruning.
A clear explanation of building all word squares using backtracking with prefix pruning.
A clear explanation of finding the shortest abbreviation that does not conflict with any dictionary word using bit masks.
A clear explanation of Android Unlock Patterns using backtracking, a jump table, and symmetry optimization.
A clear explanation of Generalized Abbreviation using backtracking to choose whether each character is kept or abbreviated.
A clear explanation of Additive Number using split enumeration and deterministic checking.
A clear explanation of Remove Invalid Parentheses using BFS to guarantee the minimum number of removals.
A recursive game theory solution with memoization for deciding whether the starting player can force a win.
A backtracking solution for matching a pattern string to a target string using a bijective character-to-substring mapping.
A backtracking solution for inserting operators into a numeric string so the expression evaluates to a target value.
A clear explanation of the Palindrome Permutation II problem using character counts and backtracking over half of the palindrome.
A clear explanation of the Binary Tree Paths problem using DFS backtracking to collect every root-to-leaf path.
A clear explanation of the Factor Combinations problem using DFS backtracking with non-decreasing factors.
A clear explanation of finding k distinct numbers from 1 to 9 that sum to n using backtracking.
A clear explanation of finding multiple words in a character board using a Trie and DFS backtracking.
A clear explanation of designing a word dictionary with addWord and wildcard search using a Trie and DFS.
A detailed guide to solving Unique Binary Search Trees II with recursive tree generation over value ranges.
A detailed guide to solving Restore IP Addresses with backtracking over four valid IP segments.
A detailed guide to solving Subsets II with sorting, backtracking, and duplicate skipping.
A detailed guide to solving Gray Code using the binary-to-Gray-code formula.
A detailed guide to solving Word Search with depth-first search and backtracking on a grid.
A detailed guide to solving Subsets with backtracking and the include-or-skip recursion idea.
A detailed guide to solving Combinations with backtracking and pruning.
Return all valid sentences formed by inserting spaces into a string so every word belongs to the dictionary, using DFS with memoization.
Generate all ways to split a string so that every piece is a palindrome, using backtracking with palindrome precomputation.
Find all shortest word transformation sequences using BFS to build shortest-path parents, then backtracking to reconstruct every answer.
A clear explanation of finding all root-to-leaf paths whose values add up to a target sum using depth-first search and backtracking.
A clear guide to solving N-Queens II by counting valid queen placements with backtracking.
A clear guide to solving N-Queens with backtracking, row-by-row placement, and constant-time conflict checks.
A clear explanation of finding unique combinations that sum to a target when each array element may be used at most once.
A clear explanation of finding all unique combinations that sum to a target using backtracking.
A clear explanation of solving a Sudoku board using backtracking and constraint checking.
A detailed explanation of generating all well-formed parentheses strings using backtracking.
A detailed explanation of generating all possible phone keypad letter combinations using backtracking.