Euclidean Distance Matrix
Write a function to compute the Euclidean distance between every pair of points from two lists.
Parse key=value pairs
Implement a parser that converts a space-separated 'key=value' string into a Python dictionary, supporting quoted values.
Parse coordinate pairs
Parse a string of coordinate pairs into a list of coordinate lists.
Zip lists into pairs
Write a function that takes two lists and returns a list of two-element sublists pairing elements by index up to the shortest length.
Unzip pairs into two lists
Write a function that takes a list of pairs and returns two separate lists: first elements and second elements.
Zip Two Lists
Write a function that pairs elements from two lists by index, stopping at the shorter list.
Count Adjacent Pairs
Given a list of integers and a target, count adjacent pairs whose sum equals the target.
Cartesian Product Pairs
Create a function that returns the Cartesian product of two lists as a sorted list of lists.
Two Sum with Dict
Implement the classic Two Sum problem: return indices of two numbers that add up to a target using a dict.
Pair with difference K
Count unordered index pairs with absolute difference exactly K, handling duplicates correctly.
Count Pairs with Sum
Implement a function that counts the number of distinct pairs in a list summing to a target.
Revenue by Month
Write a function that groups a list of (date, amount) pairs by year-month and returns total revenue per month as a sorted dictionary.
Count pairs with given difference
Count how many unordered pairs in a list have a given absolute difference using an efficient approach.
Top N per group
Implement top_n_per_group that returns the top N scores for each group from a list of (group, score) pairs.
Pairwise Sequence Pairs
Write a generator function pairwise that yields each consecutive overlapping pair from any iterable as lists.
Amicable Numbers Check
Write a function that checks if two numbers are an amicable pair by comparing sums of proper divisors.
Chinese Remainder Theorem
Solve a system of congruences with pairwise coprime moduli using the Chinese Remainder Theorem.
Compress Bits Run
Write a function that compresses a binary string by representing consecutive identical bits as a count-bit pair.
Maximum XOR Pair
Implement max_xor_pair(nums) that returns the maximum XOR value obtainable by pairing any two numbers in the given list.
Clique Detection
Given an undirected graph and a list of vertices, check if every pair of distinct vertices in the list is connected by an edge.
Floyd-Warshall: All-Pairs Shortest Paths
Implement the Floyd-Warshall algorithm to find all-pairs shortest path distances in a directed graph with possibly negative weights but no negative cycles.
Generate Parentheses
Given n, generate all valid strings of n pairs of parentheses.
Queue Reconstruction by Height
Given shuffled pairs of (height, number_of_taller_people_in_front), reconstruct the original queue order.
Reverse Pairs Count
Implement a function to count reverse pairs in an array efficiently.
Showing 1–24 of 26 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.