All Paths from Source to Target
Given a directed acyclic graph, return all paths from node 0 to the last node.
Topological Sort via DFS
Return a deterministic topological ordering of nodes in a directed acyclic graph using DFS, or an empty list if a cycle exists.
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 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.
Combination Sum
Given a list of distinct positive integers and a target, return all unique combinations that sum to the target.
Partition Labels
Partition a string into maximal parts where each character appears in only one part, returning part lengths.
Boats to Save People
Given a list of people weights and a boat's weight limit, return the minimum number of boats required.
Non-overlapping Intervals
Given a list of intervals, return the minimum number of intervals to remove to make the rest non-overlapping.
Kth Missing Positive
Given a strictly increasing array and an integer k, return the k-th positive integer that is missing from the array.
Single Element in Sorted Array
Given a sorted array where every element appears exactly twice except one which appears once, return the single element.
Book Allocation: Minimize Maximum Pages
Implement a function that returns the minimized maximum pages when allocating a list of books to k students.
Nth Magical Number
Given three integers n, a, b, return the nth positive integer that is divisible by either a or b.
Find k Closest Elements to Target
Return exactly k elements from a sorted list that are closest to a given target, preserving order.
Three Sum
Given an array of integers, return all unique triplets that sum to zero.
Closest Three Sum
Given an array of integers and a target, return the sum of three numbers that is closest to the target.
Interval List Intersections
Given two lists of sorted, disjoint intervals, return the list of intersections between them.
Minimum Size Subarray Sum
Given an array of positive integers, return the minimal length of a contiguous subarray with sum at least target, or 0 if none exists.
Fruit into Baskets
Given an array of integers representing fruit types, return the maximum number of fruits you can collect in a contiguous subarray with at most two distinct types.
Boats to Save People – Two Pointer
Implement a function that returns the minimum number of boats needed to rescue everyone, given a weight limit and each boat carrying at most two people.
Sliding Window Median
Given a list of integers and a positive window size k, return the median of each sliding window of length k.
Showing 49–72 of 96 challenges · medium
Guide: free Python coding challenges
Practice Python by solving problems
PythonSkillset challenges are hands-on coding exercises from beginner to advanced. Open a challenge, read the problem, write Python in the split-pane editor, and run tests with Pyodide — no install required.
How to use the arena
- Pick a category — basics, algorithms, strings, and more
- Open a challenge, read the statement, and edit the starter code
- Run tests, fix failures, then try a related quiz or tutorial lesson
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.