Permutation Generator
Write a function that returns all permutations of a list of distinct integers.
Combination Generator
Write a recursive function that returns all combinations of length k from a list of distinct integers.
Letter Combinations of a Phone Number
Given a string of digits, return all possible letter combinations that the number could represent on a phone keypad.
Permutations
Write a function that returns every permutation of the elements in the input list.
Permutations II
Return all distinct permutations of a list of integers that may include duplicates.
Subsets
Return all subsets (the power set) of a list of distinct integers.
Subsets II
Given a collection of integers that might contain duplicates, return all possible unique subsets.
Palindrome Partitioning
Given a string s, return all possible palindrome partitioning of s.
Remove invalid parentheses
Given a string with parentheses and letters, return all valid strings after removing the minimum number of invalid parentheses.
Power set from set
Write a function to return the power set of a given list of distinct elements.
Combination Sum
Given a list of distinct positive integers and a target, return all unique combinations that sum to the target.
Showing 1–11 of 11 challenges · Recursion & Backtracking
Recursion & Backtracking — Python coding challenges
What you will find here
This page lists recursion & backtracking challenges — real Python problems you solve in the browser IDE with instant test feedback. Each challenge includes a clear brief, starter code, and automated checks.
Challenges vs tutorials and quizzes
Challenges test what you can build under constraints. For guided teaching, use our Python tutorials. For quick checks, try quizzes or copy snippets from code samples.