Zigzag string conversion
Encode a string in zigzag order across numRows rows, then read row by row.
Custom Sort String
Given a string s and an order string, reorder s so that characters that appear in order come first in that order, and all other characters are appended in stable original order.
Function composition
Return a function that applies f after g: compose(f, g)(x) == f(g(x)).
BFS level-order traversal
Return the level-order traversal of a binary tree as a list of lists.
Heap Sort Implementation
Implement the heap sort algorithm to sort a list of comparable elements in non-decreasing order.
Radix Sort
Implement LSD radix sort to sort a list of non-negative integers in ascending order.
Reconstruct Itinerary
Given a list of airline tickets, reconstruct the itinerary in order using each ticket exactly once, choosing the lexicographically smallest path when multiple options exist.
AST Visitor Lite
Implement a depth-first traversal of a simplified AST and return identifier names in order.
Level Order Traversal
Implement a function that performs a level order traversal of a binary tree and returns node values as a list of lists.
Strobogrammatic number II
Given a positive integer n, return all strobogrammatic numbers of length n in ascending order.
Interleaving string
Given three strings s1, s2, and s3, check if s3 is formed by interleaving s1 and s2 while preserving the order of each input string.
Vertical Order Traversal
Compute the vertical order traversal of a binary tree, grouping nodes by column and row.
Kth Smallest in BST
Implement a function that returns the k-th smallest value in a binary search tree.
Zigzag Level Order Traversal
Implement a function that returns the zigzag level-order traversal of a binary tree.
Alien Dictionary Order
Given a sorted list of words in an alien language, derive the order of its unique letters.
Topological Sort via DFS
Return a deterministic topological ordering of nodes in a directed acyclic graph using DFS, or an empty list if a cycle exists.
Course Schedule Ordering
Determine a valid sequence to complete all courses respecting prerequisite constraints.
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.
Queue Reconstruction by Height
Given shuffled pairs of (height, number_of_taller_people_in_front), reconstruct the original queue order.
Capacity to Ship Packages
Given package weights and days allowed, compute the smallest ship capacity that can deliver all packages in order within the given days.
Find k Closest Elements to Target
Return exactly k elements from a sorted list that are closest to a given target, preserving order.
Validate Stack Sequences
Given two sequences of distinct integers, verify whether the second sequence is a valid pop order for a stack given the first sequence as push order.
Asteroid Collision
Simulate asteroid collisions with a stack and return the remaining asteroids in original order.
Top K Frequent Elements
Given a list of integers and a number k, return the k most frequent elements in descending order of frequency, with ties broken by larger value.
Showing 1–24 of 30 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.