Tag: backtracking
Combination Sum - 3rd attempt
Date: 3/2/2024Tags:algorithmsleetcodebacktrackingThe journal entry explores the importance of maintaining the state of the `comb` array while implementing a backtracking algorithm for the Combination Sum problem, emphasizing the need for proper backtracking steps and understanding recursive calls to explore possibilities accurately, illustrated through provided JavaScript code.
Subset
Date: 2/22/2024Tags:algorithmsleetcodebacktrackingThe journal entry explores the Subset problem, detailing the backtracking algorithm utilized to generate all possible subsets of a given set of numbers without duplicates or repeated elements in different orders.
Word Search - 3rd attempt
Date: 2/13/2024Tags:algorithmsleetcodebacktrackingThe journal entry discusses nuances of an algorithm for solving the word search problem, including the importance of unmarking visited cells to avoid circular paths and the optimization of stopping exploration after finding one valid path. The provided material is a code snippet implementing the algorithm in TypeScript.
Word Search - 2nd attempt
Date: 2/12/2024Tags:algorithmsleetcodebacktrackingThe journal entry provides an explanation of the author's second attempt at solving the "Word Search" problem using a backtracking strategy, and includes a code snippet for the implementation.
Combination Sum - 2nd attempt
Date: 2/12/2024Tags:algorithmsleetcodebacktrackingThe journal entry describes improvements made to a backtracking approach for solving the Combination Sum problem. The algorithm now checks for the endpoint before calling the recursive function, and it takes advantage of the sorted "candidates" array to stop early. The code provided is a function that implements the revised approach.