Union of Many Sets
Implement a function that takes any number of sets and returns a sorted list of their union.
Top k keys by count
Given a dictionary mapping keys to counts, return the top k keys with the highest counts, breaking ties alphabetically.
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.
Sort by frequency
Sort a list by element frequency descending, with ties broken by order of first occurrence.
Frequency sort descending
Write a function that sorts a list by frequency descending while preserving original order for ties.
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.
Bubble Sort
Implement bubble sort that sorts a list of numbers in ascending order.
Selection Sort Implementation
Implement selection sort to sort a list of numbers in ascending order.
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).
Shell Sort
Implement Shell sort, an in-place comparison sort that generalizes insertion sort, using a gap sequence that shrinks by half each pass.
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 Two Sorted Lists
Write a function that merges two sorted lists into a single sorted list.
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.
Argsort Indices
Implement a function that returns the indices that would sort a list of integers, with ties broken by original order.
Merge K Sorted Lists
Write a function that merges multiple sorted lists into a single sorted list.
Accounts Merge
Given a list of accounts, merge those that share any email and return sorted accounts.
Showing 25–48 of 73 challenges
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.