Backtracking
This page provides links to solutions that use the backtracking technique.
Overview
Backtracking is a general algorithmic technique used to solve problems by incrementally building candidates. For example, classic queen problem, for this problem we start by assigning each queen to one of the rows and use backtracking to adjust the placement if the current arrangement does not satisfy the conditions for placing queens on an chessboard.
How to Spot These Problems
You can identify backtracking problems:
- If the problem requires you to explore all possible outcomes.
- If the size of the input is very small.
Leetcode Problem Set
# ▲ | Solution |
---|---|
1467 | Probability of a Two Boxes Having The Same Number of Distinct Balls |
1723 | Find Minimum Time to Finish All Jobs |
2305 | Fair Distribution of Cookies |