Take n Items
Given a list and a non-negative integer n, return a new list containing the first n elements.
Jump Game Minimum Jumps
Given an array of non-negative integers where each element is the maximum jump length, compute the minimum jumps to reach the last index.
Integer to Roman
Convert a positive integer to its Roman numeral representation.
Repeat each character n times
Given a string s and an integer n, return a new string where each character of s is repeated n times consecutively.
Extract Digits Only
Given a string that may contain letters, symbols, and whitespace, extract all digits in order and return them as an integer.
Roman to Integer
Convert a valid Roman numeral string to an integer using standard rules.
Strip Leading Zeros
Write a function that strips leading zeros from a string representing a non-negative integer.
Find all numbers in text
Write a function that extracts all standalone integers from a text string using regular expressions.
Hex encode decode
Write hex_encode and hex_decode to convert between hex strings and integer byte values.
Parse Hex Dump
Write a function that parses a hex dump string into a list of integers.
Flatten nested list
Yield every integer from an arbitrarily nested list, depth-first.
Running Product of Integers
Given a list of integers, return a new list where each element at index i is the product of all elements from index 0 to i.
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.
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.
Count Smaller Numbers
Given an integer list, return for each position how many later elements are smaller than it.
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.
Showing 25–48 of 163 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.