Find Duplicate Number
Given a list of n+1 integers in the range 1..n, find the one integer that appears more than once.
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.
Sort array by parity
Given a list of integers, return a new list with all evens first and odds last, preserving original relative order.
Count Adjacent Pairs
Given a list of integers and a target, count adjacent pairs whose sum equals the target.
Sort List Merge Sort
Write a function that sorts a list of integers using the merge sort algorithm.
Flatten Multidimensional Lists
Write a function that flattens arbitrarily nested lists of integers into a single list.
Keys Sorted by Value Descending
Given a dictionary mapping strings to integers, return a list of keys sorted by value descending, and when values tie, alphabetically ascending.
Longest Harmonious Subsequence
Given a list of integers, find the length of the longest harmonious subsequence where the difference between maximum and minimum values is exactly 1.
Longest Consecutive Sequence
Given an unsorted list of integers, find the length of the longest consecutive elements sequence in O(n) time.
Pascal Triangle Row
Given a non-negative integer n, return the nth row of Pascal's triangle as a list of integers.
Radix Sort
Implement LSD radix sort to sort a list of non-negative integers in ascending order.
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.
Argsort Indices
Implement a function that returns the indices that would sort a list of integers, with ties broken by original order.
Arithmetic Slices Count
Given a list of integers, count how many contiguous subarrays of length at least 3 form an arithmetic sequence.
Descriptor Property
Create a descriptor class that ensures attribute values are positive integers.
Digit Expansion Generator
Create a generator that lazily yields each decimal digit of a non-negative integer from most significant to least significant.
Flatten Nested List Iterator
Implement a class that iterates over all integers in a nested list structure in depth-first order.
Parse Error Recovery
Parse a whitespace-separated string into a list of valid integers, skipping invalid tokens.
Nth Triangular Number
Implement a function that returns the nth triangular number efficiently.
Euler Totient Function
Implement Euler's totient function φ(n) for positive integers.
Showing 25–48 of 93 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.