Set symmetric difference
Write a function that returns the elements found in exactly one of two sets, sorted ascending.
Remove Duplicates from Sorted Array
Given a sorted list, remove duplicates in-place and return the new length.
Sort characters alphabetically
Sort all characters in a string alphabetically and return the sorted string.
Sort characters in string
Write a function that sorts the characters in a string and returns the sorted string.
Remove duplicates (sorted)
Return a sorted list with duplicates removed.
Merge two sorted arrays
Merge two sorted arrays into one sorted array.
Insert into a Sorted List
Implement a function that inserts a value into a sorted list at the correct position using binary search.
Intersection of Two Lists
Given two lists, return a sorted list of unique elements that appear in both lists.
Merge Sorted Array In Place
Write a function that merges two sorted arrays into the first array in-place, keeping the result sorted.
Cartesian Product Pairs
Create a function that returns the Cartesian product of two lists as a sorted list of lists.
List intersection
Return the sorted list of elements common to both lists.
Keys Sorted by Value Descending
Given a dictionary mapping strings to integers, return a list of keys sorted by value descending, and when values tie, alphabetically ascending.
Anagram Dictionary Groups Lite
Group a list of words into anagrams using a dictionary keyed by sorted characters.
Common Keys of Two Dictionaries
Implement a function that finds keys shared by two dictionaries and returns them sorted.
Union of Many Sets
Implement a function that takes any number of sets and returns a sorted list of their union.
Anagram Groups by Size
Group a list of words into anagram groups and return them sorted by group size and lexicographically.
Top K Frequent Words
Given a list of words, return the k most frequent words sorted by frequency (descending) and then alphabetically.
Symmetric Difference
Write a function that computes the symmetric difference of two lists, returning a sorted list of unique elements.
Binary search
Return the index of target in a sorted list, or -1 if not present.
Exponential Search
Implement exponential search to find any valid index of a target in a sorted list.
Sieve of Eratosthenes
Implement the Sieve of Eratosthenes to return a sorted list of all primes up to a given integer n.
Prime Factorization
Return a sorted list of prime factors of a positive integer, including repeated factors.
Shortest Unsorted Continuous Subarray
Given an array of integers, return the length of the shortest contiguous subarray whose sorting makes the whole array sorted.
Search Insert Position
Return the index where a target should be inserted into a sorted list to maintain order.
Upper Bound Binary Search
Write a function that returns the index of the first element greater than a target in a sorted list.
Find Indices of Target in Sorted List
Given a sorted list and a target, return the indices of its first and last occurrence, or [-1, -1] if absent.
Two Sum Sorted
Given a 1-indexed sorted array and a target, return the two indices that add up to the target.
Squares of Sorted Array
Implement a function that returns a sorted list of squares for a given non-decreasing integer array.
Showing 28 challenges · easy
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.