Maximum subarray (Kadane)
Find the contiguous subarray with the largest sum.
Rotate array
Rotate a list right by k positions in place.
Product except self
Return an array where output[i] is the product of all elements except nums[i], without using division.
Product of All Except Zeros Handling
Given a list of integers, return a list where each element is the product of all other elements, handling zeros correctly.
Find Duplicate Number
Given a list of n+1 integers in the range 1..n, find the one integer that appears more than once.
Partition Array
Implement a function that finds a contiguous partition of a list into k groups, minimizing the maximum sum of the groups.
Two Missing Numbers
Given a list of n-2 unique integers from 1 to n, find the two missing numbers efficiently.
Three Missing Numbers
Find the three missing numbers from a shuffled list containing all but three integers from 1 to n.
Subarray sum equals K
Count the number of contiguous subarrays whose sum equals k.
Find Peak Element
Implement a function that returns the index of any peak element in an integer array.
Longest Consecutive Sequence
Given an unsorted list of integers, find the length of the longest consecutive elements sequence in O(n) time.
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 Circular
Solve the House Robber problem with houses arranged in a circle.
Unique Paths with Obstacles
Given a 2D grid with obstacles, count the unique paths from top-left to bottom-right moving only down or right.
Maximal square
Given a 2D binary matrix of 0s and 1s, compute the area of the largest square containing only 1s.
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.
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.
Container With Most Water
Given an array of heights, find the maximum area between two vertical lines that can hold water.
Sort Colors (Dutch National Flag)
Implement the Dutch National Flag algorithm to sort an array of 0, 1, 2 in one pass.
Count Nice Subarrays
Given an array of integers, count the number of contiguous subarrays that contain exactly k odd numbers.
Top K Frequent Elements
Given an integer array and a number k, return the k most frequent elements using a heap-based approach.
Showing 23 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.