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.
Maximum subarray (Kadane)
Find the contiguous subarray with the largest sum.
Partition Array
Implement a function that finds a contiguous partition of a list into k groups, minimizing the maximum sum of the groups.
Online Stock Span
Implement StockSpanner.next(price) that returns the maximum number of consecutive days (including today) with price <= current price.
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.
Unbounded Knapsack
Given item weights and values with unlimited copies, find the maximum total value that fits in a knapsack capacity.
Buy Sell Stock with Cooldown (DP)
Given daily stock prices, compute the maximum profit you can achieve if you must wait one day after selling before buying again.
Maximal square matrix
Given a 2D binary matrix of 0s and 1s, find the side length of the largest square containing only 1s.
Delete and Earn
Given an array of integers, find the maximum points you can earn by repeatedly deleting a number and all its adjacent values.
Maximum Width of a Binary Tree
Given the root of a binary tree, compute its maximum width (the maximum number of nodes in any level, counting null positions).
Most stones removed
Given stone coordinates on a grid, find the maximum number of stones that can be removed while every stone shares a row or column with another remaining stone.
Bag of Tokens Score
Given tokens with values and initial power, determine the maximum score achievable by selling tokens for power or buying tokens for score.
Painter Partition Problem
Given board lengths and k painters, find the minimum possible maximum total length a painter must paint.
Jump Game Reachable
Given an array of non-negative integers where each element is the maximum jump length, determine if you can reach the last index.
Max events attended
Given a list of events with start and end times, find the maximum number of non-overlapping events you can attend.
Ternary Search
Implement ternary search to locate the maximum of a discrete unimodal function.
Maximum Running Time of n Computers
Use binary search to maximize the running time for n computers with batteries.
Binary Search on Answer: Find the Minimal Maximum Subarray Sum
Implement a function that finds the minimal possible maximum subarray sum when splitting an array into at most k contiguous subarrays.
Book Allocation: Minimize Maximum Pages
Implement a function that returns the minimized maximum pages when allocating a list of books to k students.
Minimum Limit of Balls in a Bag
Given an array of bag sizes and a number of allowed splits, find the minimum possible maximum bag size.
Container With Most Water
Given an array of heights, find the maximum area between two vertical lines that can hold water.
Showing 1–24 of 28 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.