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.
House Robber Circular
Solve the House Robber problem with houses arranged in a circle.
Triangle Minimum Path
Compute the minimum path sum from top to bottom of a triangle given as a list of lists.
Paint House Colors
Given a cost matrix, compute the minimum total cost to paint all houses with no two adjacent houses having the same color.
Create Maximum Number
Given two arrays of digits and an integer k, merge them to form the largest number of length k.
Shortest Unsorted Continuous Subarray
Given an array of integers, return the length of the shortest contiguous subarray whose sorting makes the whole array sorted.
Target sum assignments
Given a list of integers and a target, count how many ways to assign + or - to each number so the total equals the target.
Split Array Largest Sum
Minimize the largest sum among k contiguous subarrays using dynamic programming.
Candy Distribution
Compute the minimum total candies needed so that every child gets at least one and children with higher ratings than neighbors get more candies.
Patching Array
Given a sorted array of positive integers and a target n, find the minimum number of patches to make every number from 1 to n representable as a subset sum.
Job Sequencing with Deadlines and Profits
Given jobs with deadlines and profits, choose a subset that maximizes profit while meeting deadline constraints.
Gas Station Circuit
Given gas and cost arrays for a circular route, determine the starting gas station index that allows a full loop, or -1 if none exists.
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.
Non-overlapping Intervals
Given a list of intervals, return the minimum number of intervals to remove to make the rest non-overlapping.
Search in Rotated Array
Implement an efficient search in a rotated sorted array using modified binary search.
Search Insert Position
Return the index where a target should be inserted into a sorted list to maintain order.
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.
Koko Eating Bananas
Given piles of bananas and hours, find the minimum integer eating speed Koko needs to finish all piles within H hours.
Capacity to Ship Packages
Given package weights and days allowed, compute the smallest ship capacity that can deliver all packages in order within the given days.
Median of Sorted Array BS
Implement a binary search algorithm to find the median of two sorted arrays efficiently.
Kth Missing Positive
Given a strictly increasing array and an integer k, return the k-th positive integer that is missing from the array.
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.
Showing 49–72 of 121 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.