Find Missing Number
Given a list of n distinct integers from 0..n with one missing, return the missing number.
Maximum subarray (Kadane)
Find the contiguous subarray with the largest sum.
Rotate array
Rotate a list right by k positions in place.
Remove duplicates (sorted)
Return a sorted list with duplicates removed.
Merge two sorted arrays
Merge two sorted arrays into one sorted array.
Product except self
Return an array where output[i] is the product of all elements except nums[i], without using division.
Sliding window maximum
Return the maximum of each window of size k as it slides across an array.
Second Largest Unique Value
Return the second largest distinct integer from a list, or None if it doesn't exist.
Find Missing Number 1 to n
Given a list containing n-1 distinct integers from 1 to n, find the missing number without using extra space.
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.
Majority Element Finder
Implement a function that returns the majority element in a list, which appears more than half the time.
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.
Rearrange Positives and Negatives
Write a function that rearranges a list in-place so all negative numbers come before non-negative numbers.
Wave sort array
Given a list of integers, reorder it into a wave pattern where elements alternate down-up, and return the new list.
Counting Sort
Implement the counting sort algorithm to sort a list of non-negative integers in O(n + k) time.
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.
Index of peak element
Implement a function that returns the index of any peak element in a given integer array.
Count pairs with given difference
Count how many unordered pairs in a list have a given absolute difference using an efficient approach.
Find Peak Element
Implement a function that returns the index of any peak element in an integer array.
Previous Smaller Element
Find the nearest previous index with a smaller value for every element in an array.
Median of Two Sorted Arrays
Given two sorted arrays, return the median of the combined sorted array in O(log(min(n,m))) time.
Pascal Triangle Row
Given a non-negative integer n, return the nth row of Pascal's triangle as a list of integers.
Bubble Sort
Implement bubble sort that sorts a list of numbers in ascending order.
Single Number XOR
Given a non-empty list of integers where every element appears twice except one, return the single number using XOR.
Missing Number XOR
Given a list of n distinct numbers from 0 to n with one missing, use XOR to find and return the missing number.
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.
Search in Rotated Array
Implement an efficient search in a rotated sorted array using modified binary search.
Best Time to Buy and Sell Stock
Given a list of daily stock prices, determine the maximum profit achievable by buying on one day and selling on a later day.
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.
Subarrays with K different ints
Count the number of contiguous subarrays that contain exactly K distinct integers.
Next Greater Element
Return a list where each position holds the next greater element to the right, or -1 if none exists.
Showing 40 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.