Sliding window maximum
Return the maximum of each window of size k as it slides across an array.
Curry a function
Auto-curry any multi-argument function so it returns partial applications until fully saturated.
LRU cache decorator
Implement @lru_cache(maxsize=N) for unary functions using OrderedDict.
Longest increasing subsequence
Return the length of the longest strictly increasing subsequence.
Topological sort (Kahn)
Return a valid topological ordering of tasks, or [] if a cycle exists.
Word ladder length
Return the length of the shortest transformation from beginWord to endWord changing one letter at a time.
Median of Two Sorted Arrays
Given two sorted arrays, return the median of the combined sorted array in O(log(min(n,m))) time.
Data pipeline
Implement a Pipeline class supporting pipe chaining with the | operator.
Validated descriptor
Implement a TypedField descriptor that raises TypeError if the value is not of the expected type.
Match IPv6 Address
Write a function that uses a regex to validate whether a string is a fully expanded IPv6 address.
Palindrome Partitioning Minimum Cuts
Given a string, return the minimum number of cuts needed such that every substring in the partition is a palindrome.
Egg Drop Puzzle
Given k eggs and n floors, compute the minimum number of attempts required in the worst case to find the highest safe floor.
Dijkstra Shortest Path
Implement Dijkstra's algorithm on a weighted graph to return distances from a source to every node.
Minimum Cut
Given an undirected graph in adjacency-list form, return the size of the minimum edge cut that disconnects the graph.
Trapping Rain Water
Given an array of non-negative integers representing an elevation map, compute how much water it can trap after raining.
Minimum Window Substring
Implement a sliding window algorithm to find the minimum window substring containing all characters of a given pattern.
Subarrays with K different ints
Count the number of contiguous subarrays that contain exactly K distinct integers.
Showing 17 challenges · hard
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.