Custom Sort String
Given a string s and an order string, reorder s so that characters that appear in order come first in that order, and all other characters are appended in stable original order.
Merge intervals
Merge all overlapping intervals and return a sorted result.
Count Smaller Numbers
Given an integer list, return for each position how many later elements are smaller than it.
Group anagrams
Group words that are anagrams of each other.
Design Twitter Feed
Implement a Twitter class with postTweet, getNewsFeed, follow, and unfollow methods.
Quicksort
Implement quicksort and return a sorted list.
Count inversions lite
Implement a function that counts inversions in a list of numbers efficiently.
Longest Consecutive Sequence
Given an unsorted list of integers, find the length of the longest consecutive elements sequence in O(n) time.
Merge Sort
Implement merge_sort(numbers) that returns a sorted copy of the input list using the merge sort algorithm.
Heap Sort Implementation
Implement the heap sort algorithm to sort a list of comparable elements in non-decreasing order.
Radix Sort
Implement LSD radix sort to sort a list of non-negative integers in ascending order.
Bucket Sort
Implement bucket sort to sort a list of floating-point numbers in the range [0,1).
Reconstruct Itinerary
Given a list of airline tickets, reconstruct the itinerary in order using each ticket exactly once, choosing the lexicographically smallest path when multiple options exist.
K Closest Elements
Implement a function to return the k closest elements to a target in a sorted array.
Merge time intervals
Given a list of time intervals, merge all overlapping intervals and return the merged intervals.
Top N per group
Implement top_n_per_group that returns the top N scores for each group from a list of (group, score) pairs.
Delete duplicates sorted II
Given a sorted list, remove duplicates in place so each element appears at most twice, returning the new length.
Accounts Merge
Given a list of accounts, merge those that share any email and return sorted accounts.
Vertical Order Traversal
Compute the vertical order traversal of a binary tree, grouping nodes by column and row.
Alien Dictionary Order
Given a sorted list of words in an alien language, derive the order of its unique letters.
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.
Course Schedule Ordering
Determine a valid sequence to complete all courses respecting prerequisite constraints.
Permutations II
Return all distinct permutations of a list of integers that may include duplicates.
Combination Sum
Given a list of distinct positive integers and a target, return all unique combinations that sum to the target.
Showing 1–24 of 54 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.