Count pairs with given difference
Count how many unordered pairs in a list have a given absolute difference using an efficient approach.
Previous Smaller Element
Find the nearest previous index with a smaller value for every element in an array.
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.
Exponential Search
Implement exponential search to find any valid index of a target in a sorted list.
Find Peak Index
Given a list of integers, return the index of any peak element where the value is not smaller than its neighbors.
Peak Element in Array
Implement a function that returns the index of any peak element in a list of integers.
Consecutive available seats
Given a list of seat statuses, return the length of the longest consecutive run of available (0) seats.
Sieve of Eratosthenes
Implement the Sieve of Eratosthenes to return a sorted list of all primes up to a given integer n.
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.
Min cost climbing stairs
Compute the minimum total cost to reach the top of a staircase, given you can climb 1 or 2 steps at a time.
House Robber
Given a list of house values, return the maximum sum you can rob without robbing two adjacent houses.
Triangle Minimum Path
Compute the minimum path sum from top to bottom of a triangle given as a list of lists.
Shortest Unsorted Continuous Subarray
Given an array of integers, return the length of the shortest contiguous subarray whose sorting makes the whole array sorted.
Find the Town Judge
Given n people and a trust array, return the town judge or -1.
Find center of star graph
Write a function that finds the center node of a star graph from its list of edges in O(1) time.
Stock Buy Sell Once
Given daily stock prices, compute the maximum profit you can achieve from buying once and selling once later.
Maximum Ice Cream Bars
Given costs of ice cream bars and coins, return the maximum number you can buy.
Search Insert Position
Return the index where a target should be inserted into a sorted list to maintain order.
Lower Bound Binary Search
Implement binary search to find the first index where an element is not less than a given target.
Upper Bound Binary Search
Write a function that returns the index of the first element greater than a target in a sorted list.
First Bad Version
Implement a function to find the first bad version in a sorted range using 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.
Showing 25–48 of 68 challenges · easy
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.