Max of a variable-length list
Implement a function that returns the maximum value from a list of numbers without using max().
Max of three numbers
Implement a function that returns the maximum of three numbers using comparisons.
Range of values
Calculate the range (max minus min) of a list of numbers. Empty list returns 0.
Argmax along axis
Write a function that returns index positions of the maximum values along rows or columns of a 2D list.
Min-Max Scaler: Fit and Transform
Implement a MinMaxScaler class that normalizes numeric data to a given range using fit and transform methods.
Jump Game Minimum Jumps
Given an array of non-negative integers where each element is the maximum jump length, compute the minimum jumps to reach the last index.
Longest Word Finder
Write a function that extracts alphabetic words from a string and returns the longest one, with ties broken by earliest position.
Maximum subarray (Kadane)
Find the contiguous subarray with the largest sum.
Sliding window maximum
Return the maximum of each window of size k as it slides across an array.
Running Maximum
Implement a function that returns a list where each element is the largest value seen so far.
Average excluding min and max
Return the average of a list after discarding the lowest and highest elements, handling edge cases.
Find Second Largest
Find the second largest unique number in a list, or None if it doesn't exist.
Partition Array
Implement a function that finds a contiguous partition of a list into k groups, minimizing the maximum sum of the groups.
Normalize Array to Zero-One Range
Implement a function that normalizes a list of numbers to the range [0,1] using min-max scaling.
Longest Harmonious Subsequence
Given a list of integers, find the length of the longest harmonious subsequence where the difference between maximum and minimum values is exactly 1.
LRU cache decorator
Implement @lru_cache(maxsize=N) for unary functions using OrderedDict.
Largest Rectangle in Histogram
Given an array of bar heights, compute the largest rectangle that can be formed by consecutive bars.
Online Stock Span
Implement StockSpanner.next(price) that returns the maximum number of consecutive days (including today) with price <= current price.
Largest Area Histogram Matrix
Given a binary matrix, compute the largest rectangle area consisting entirely of 1s.
Rate Limit Decorator
Implement a decorator that enforces a maximum number of calls per second for any function.
Maximum XOR Pair
Implement max_xor_pair(nums) that returns the maximum XOR value obtainable by pairing any two numbers in the given list.
Kadane Variant: Maximum Product Subarray
Implement max_product_subarray(nums) that returns the maximum product of any contiguous subarray.
Max Profit from Selling Twice
Compute the maximum profit that can be achieved by completing at most two buy-sell transactions on a given price array.
House Robber
Given a list of house values, return the maximum sum you can rob without robbing two adjacent houses.
Showing 1–24 of 68 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.