Running Total Window
Implement a function that returns a list of running totals, resetting to zero after each positive sum.
Normalize Array to Zero-One Range
Implement a function that normalizes a list of numbers to the range [0,1] using min-max scaling.
Linear Interpolation Array
Given an array with some None values, replace them by linear interpolation between the nearest known values.
Convolve 1D Signal
Write a function that computes the 1D convolution of two lists in 'full' mode.
Subarray sum equals K
Count the number of contiguous subarrays whose sum equals k.
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.
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.
Find Peak Index
Given a list of integers, return the index of any peak element where the value is not smaller than its neighbors.
Count of Range Sum
Count contiguous subarrays whose sum lies in a given inclusive range using an efficient divide-and-conquer algorithm.
K Closest Elements
Implement a function to return the k closest elements to a target in a sorted array.
Next greater element II
For each element in a circular array, find the next greater element (NGE) to its right, wrapping around.
Merge time intervals
Given a list of time intervals, merge all overlapping intervals and return the merged intervals.
Consecutive available seats
Given a list of seat statuses, return the length of the longest consecutive run of available (0) seats.
Delete duplicates sorted II
Given a sorted list, remove duplicates in place so each element appears at most twice, returning the new length.
Arithmetic Slices Count
Given a list of integers, count how many contiguous subarrays of length at least 3 form an arithmetic sequence.
Correlation Coefficient
Write a pure-Python function that computes the Pearson correlation coefficient between two lists of numbers.
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.
Showing 25–48 of 121 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.