Merge intervals
Merge all overlapping intervals and return a sorted result.
Quicksort
Implement quicksort and return a sorted list.
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.
K Closest Elements
Implement a function to return the k closest elements to a target in a sorted array.
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.
Alien Dictionary Order
Given a sorted list of words in an alien language, derive the order of its unique letters.
Search in Rotated Array
Implement an efficient search in a rotated sorted array using modified binary search.
Interpolation Search
Implement interpolation search in Python on a sorted list of integers.
Find Minimum in Rotated Sorted Array
Implement a function that finds the minimum element in a rotated sorted array of distinct integers in O(log n) time.
Single Element in Sorted Array
Given a sorted array where every element appears exactly twice except one which appears once, return the single element.
Rotated Array Search II
Implement a function to search for a target in a rotated sorted array with possible duplicates.
Search 2D Matrix
Given a sorted 2D matrix with sorted rows and first element of each row greater than last of previous, find target efficiently.
Find k Closest Elements to Target
Return exactly k elements from a sorted list that are closest to a given target, preserving order.
Interval List Intersections
Given two lists of sorted, disjoint intervals, return the list of intersections between them.
Buildings with ocean view
Given building heights, return sorted indices of buildings that have a clear view of the ocean to their right.
Kth Largest Element in an Array (Heap Edition)
Implement a function that returns the kth largest element in an unsorted integer array using a heap.
Find K pairs with smallest sums
Given two sorted arrays and an integer k, return the k smallest pairs (u, v) with the smallest sums, sorted by sum.
Merge two sorted lists
Merge two ascending integer lists into one sorted list.
Search a 2D Matrix II
Implement an efficient search for a target in a matrix where each row and each column is sorted in ascending order.
Serialize dict to TOML-like
Convert nested Python dicts into a simplified TOML-like string with sorted keys, type-aware formatting, and flat table sections.
Showing 1–22 of 22 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.