Backtracking — Reasoning Check

Count completions and justify pruning, branch state, and output costs.


Get every question correct to pass this checkpoint. You can review feedback, revise your answers, and submit again.

1. Combine chooses four numbers from 1..8 in increasing order. A branch has fixed prefix [2,5], so only 6,7,8 remain available. How many complete combinations extend that prefix?
2. Combination Sum has distinct positive candidates [2,3,5], reusable without limit, and target 10. How many unique combinations are returned when order inside a combination is ignored?
3. Using the standard phone mapping, digits 279 generate every letter combination. How many letter bytes are needed to store all resulting strings, excluding string headers and other metadata?
4. Generate Parentheses must produce four pairs. The current prefix is (()()), containing three opens and three closes. Which next character choices preserve the valid-prefix invariant?

Select one answer.

5. In a 5×5 N-Queens search, queens already occupy (row 0,column 0) and (row 1,column 2), using zero-based coordinates. Which column is legal for the queen in row 2?

Select one answer.

6. A Word Search optimization caches every failed DFS state using only (row,column,wordIndex), then reuses failures across different recursive paths. Why can this discard a valid answer?

Select one answer.

Join Discord