Simplify Path
Implement a function that simplifies a Unix-style absolute file path to its canonical form.
Change directory manager
Implement a function that processes `cd` commands and returns the resulting absolute path.
Path Sum II All Paths
Return all root-to-leaf paths where the sum of node values equals a target.
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.
Shortest Path in Binary Matrix
Implement BFS to find the shortest path length from (0,0) to (n-1,n-1) in an n x n binary matrix, moving through 0 cells in 8 directions.
Eulerian Path Check
Given the number of vertices and an edge list of an undirected graph, decide if it has an Eulerian path.
Unique Paths with Obstacles
Given a 2D grid with obstacles, count the unique paths from top-left to bottom-right moving only down or right.
Unique Paths in a Grid
Count distinct paths in an m x n grid moving only down or right.
Minimum Falling Path Sum
Compute the minimum falling path sum in an n x n matrix by moving down or diagonally each step.
Minimum Path Sum Matrix
Implement a function that computes the minimum path sum from the top-left to the bottom-right of a grid moving only right or down.
Dungeon Game Minimum Health
Compute the minimum initial health needed to reach the bottom-right corner of a dungeon grid without health dropping to zero or below.
Sum Root to Leaf Numbers
Given the root of a binary tree, compute the total sum of all root-to-leaf numbers.
Bellman-Ford Algorithm
Implement the Bellman-Ford algorithm to compute shortest distances from a source in a directed weighted graph with up to 100 vertices and negative edges.
A* Pathfinding Heuristic
Implement A* search on a 2D grid to find the shortest path length between two cells.
Hamiltonian Path Check
Implement a function that checks whether an undirected graph has a Hamiltonian path using DFS and backtracking.
All Paths from Source to Target
Given a directed acyclic graph, return all paths from node 0 to the last node.
Network Delay Time
Given a directed weighted graph and a starting node, find the minimum time for a signal to reach all nodes, or -1 if unreachable.
Cheapest Flights Within K Stops
Implement a function to compute the cheapest flight price from source to destination with at most K stops in a directed weighted graph.
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.
Rat in a Maze
Count the number of distinct paths a rat can take from top-left to bottom-right in a binary grid, moving down or right and avoiding walls.
Shortest Path in Binary Matrix
Compute the shortest path length from top-left to bottom-right in a binary matrix using 8-directional moves.
Showing 1–21 of 21 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.