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.
Maximum XOR Pair
Implement max_xor_pair(nums) that returns the maximum XOR value obtainable by pairing any two numbers in the given list.
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.
Find K pairs with smallest sums
Given two sorted arrays and an integer k, return the k smallest pairs (u, v) with the smallest sums, sorted by sum.
Pairwise sum of adjacent nodes
Sum each adjacent pair; keep a lone last node as-is.
Showing 1–8 of 8 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.