Backtracking is a problem-solving technique for finding all (or some) solutions to some computational problem that incrementally builds candidates to the solutions and abandons a candidate ("backtracks") as soon as it is determined that the candidate cannot possibly be completed to a valid solution. Examples of problems that can be solved using backtracking include the eight queens puzzle, the Knight's tour problem, and sudoku. While backtracking can help solve complex problems, it has disadvantages such as multiple function calls being expensive and requiring a large amount of space to store function states.