Practice: Recursion and backtracking
0 of 4 solved
About these problems
Apply, Connect, Reason and Stretch describe difficulty within this topic, not an official contest rating. Open any problem in any order; reading the chapter first is optional.
- 1Binary wordsPrint every binary string of length n in lexicographic order (0 before 1).ApplyNot started
- 2Target subsetsCount subsets of array positions whose values sum to x. The empty subset is allowed. Equal values at different positions are distinct choices.ConnectNot started
- 3Balanced bracket countCount strings containing n opening and n closing parentheses such that every prefix has at least as many openings as closings.ReasonNot started
- 4Blocked queensPlace n queens on an n by n board with blocked squares. No two queens may share a row, column or diagonal. Count all placements using only free squares.StretchNot started