Fibonacci(n)
Return the nth Fibonacci number efficiently.
Additive number sequence
Check whether a given digit string can be partitioned into a valid additive sequence where each term is the sum of the previous two.
Find Duplicate Number
Given a list of n+1 integers in the range 1..n, find the one integer that appears more than once.
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.
Count Smaller Numbers
Given an integer list, return for each position how many later elements are smaller than it.
Subarray sum equals K
Count the number of contiguous subarrays whose sum equals k.
Complex Number Class
Implement a Complex class supporting addition, subtraction, multiplication, division, equality, and string formatting.
Coin change (DP)
Find the minimum number of coins to make exactly the target amount.
Count inversions lite
Implement a function that counts inversions in a list of numbers efficiently.
Merge Sort
Implement merge_sort(numbers) that returns a sorted copy of the input list using the merge sort algorithm.
Bucket Sort
Implement bucket sort to sort a list of floating-point numbers in the range [0,1).
Decode Ways
Count the number of ways to decode a numeric string into letters using the mapping A=1 to Z=26.
Online Stock Span
Implement StockSpanner.next(price) that returns the maximum number of consecutive days (including today) with price <= current price.
Eulerian Path Check
Given the number of vertices and an edge list of an undirected graph, decide if it has an Eulerian path.
Strobogrammatic number II
Given a positive integer n, return all strobogrammatic numbers of length n in ascending order.
Multiprocessing Queue
Implement a function that uses a multiprocessing queue to compute factorials of a list of numbers in parallel.
Prime Sieve Generator
Implement a generator function that yields prime numbers from 2 up to a specified limit, using an efficient sieve approach.
LRU Memoize
Implement an LRU memoization decorator that caches results for a fixed number of arguments.
Rate Limit Decorator
Implement a decorator that enforces a maximum number of calls per second for any function.
Match Credit Card Pattern
Write a function that validates a credit card number string against a set of formatting rules.
Smith Number Check
Write a function to check if a number is a Smith number by comparing digit sums of the number and its prime factorization.
Extended Euclidean Algorithm
Implement the extended Euclidean algorithm to return (gcd, x, y) such that ax + by = gcd(a, b).
Correlation Coefficient
Write a pure-Python function that computes the Pearson correlation coefficient between two lists of numbers.
Showing 1–24 of 72 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.