backtracking
Backtracking is a problem-solving algorithmic technique that involves finding a
solution incrementally by trying different options and undoing them if they
lead to a dead end. It is commonly used in situations where you need to explore
multiple possibilities to solve a problem, like searching for a path in a maze
or solving puzzles like Sudoku. When a dead end is reached, the
algorithm backtracks to the previous decision point and explores a different
path until a solution is found or all possibilities have been exhausted.