Count Smaller Numbers
Given an integer list, return for each position how many later elements are smaller than it.
Count inversions lite
Implement a function that counts inversions in a list of numbers efficiently.
Radix Sort
Implement LSD radix sort to sort a list of non-negative integers in ascending order.
Decode Ways
Count the number of ways to decode a numeric string into letters using the mapping A=1 to Z=26.
Arithmetic Slices Count
Given a list of integers, count how many contiguous subarrays of length at least 3 form an arithmetic sequence.
Target Sum Subsets
Write a function that counts the number of subsets of a list of positive integers that sum exactly to a target.
Coin Change Ways
Count the number of distinct combinations of coins that sum to a target amount.
Unique Paths in a Grid
Count distinct paths in an m x n grid moving only down or right.
Count subsets with sum
Given a list of integers and a target sum, count how many subsets of the list sum to the target.
Target sum assignments
Given a list of integers and a target, count how many ways to assign + or - to each number so the total equals the target.
Maximum Width of a Binary Tree
Given the root of a binary tree, compute its maximum width (the maximum number of nodes in any level, counting null positions).
Android unlock patterns
Count the number of valid Android unlock patterns of a given length using a 3x3 grid with adjacency constraints.
N-Queens Count
Count the number of distinct valid placements of n non-attacking queens on an n×n chessboard.
Letter Tile Possibilities
Given a string of letter tiles, count the number of distinct non-empty sequences that can be formed using any non-empty subset in any order.
Beautiful Arrangement Count
Count the number of permutations of 1..n such that for every index i, either i is divisible by the number at that position or the number is divisible by i.
Nth Magical Number
Given three integers n, a, b, return the nth positive integer that is divisible by either a or b.
Count Nice Subarrays
Given an array of integers, count the number of contiguous subarrays that contain exactly k odd numbers.
Reverse Pairs Count
Implement a function to count reverse pairs in an array efficiently.
Subarray product less than K
Count contiguous subarrays where the product of all elements is strictly less than a target K.
Count Nice Subarrays
Count subarrays that contain exactly k odd numbers.
Top K Frequent Elements
Given an integer array and a number k, return the k most frequent elements using a heap-based approach.
Count square submatrices with all ones
Count all square submatrices consisting entirely of 1s in a binary matrix.
Showing 1–22 of 22 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.