01 Matrix Nearest Zero
Given a binary matrix, return a matrix of the same shape where each cell contains the Manhattan distance to the nearest 0.
Rotting Oranges Time
Given a grid of fresh, rotten, and empty cells, compute the minimum minutes until all fresh oranges rot, or -1 if some are unreachable.
Spiral Matrix Traversal
Implement a function that returns the elements of a 2D matrix in clockwise spiral order.
Search a 2D Matrix II
Implement an efficient search for a target in a matrix where each row and each column is sorted in ascending order.
Number of Islands in a Matrix
Count the number of distinct islands (connected groups of 1s) in a 2D binary matrix.
Shortest Path in Binary Matrix
Compute the shortest path length from top-left to bottom-right in a binary matrix using 8-directional moves.
Count square submatrices with all ones
Count all square submatrices consisting entirely of 1s in a binary matrix.
Largest Plus Sign
Compute the largest possible plus sign of 1s in an n x n grid with some cells set to 0.
Shift 2D Grid
Implement a function to shift a 2D grid right by k positions, flattening the grid and wrapping elements.
Matrix Block Sum
Given a 2D matrix and a block size, compute the sum of each block centered at every cell.
Rotate Matrix Layers
Given a square matrix, rotate each concentric layer 90 degrees clockwise.
Word Search Matrix
Given a 2D board and a word, determine if the word can be formed by sequentially adjacent cells (horizontally or vertically), without reusing cells.
Pacific Atlantic Flow
Given a height matrix, return all cells from which water can flow to both the Pacific and Atlantic oceans.
Pacific Atlantic Matrix DFS
Given a matrix of heights, return cells that can reach both Pacific and Atlantic oceans using a DFS approach.
Regions Cut by Slashes
Given a grid of slashes, count the number of connected regions formed by the slashes and the grid borders.
Julian Day Number Converter
Implement two functions to convert between Gregorian calendar dates and Julian Day Numbers using a standard formula.
Easter Date Calculator
Implement a function that returns the date of Easter Sunday for a given year using the Gregorian computus algorithm.
Extract JSON-like numbers
Parse a simplified JSON-like string without using the json module and sum all numbers found in it.
Base64 Encode/Decode
Implement two functions to encode and decode Base64 strings using the standard alphabet and padding.
Flatten nested JSON
Write a function that flattens nested JSON objects into a flat dictionary with dot-separated keys, handling lists and empty objects.
Unflatten JSON dict
Given a flat dictionary with keys like 'a.b.c', reconstruct the nested dictionary where each dotted segment becomes a nested level.
Serialize dict to TOML-like
Convert nested Python dicts into a simplified TOML-like string with sorted keys, type-aware formatting, and flat table sections.
Base64 Encode Decode
Implement Base64 encoding and decoding functions that handle padding and all standard characters.
Index Creation Query
Create an in-memory SQLite database, execute CREATE INDEX statements, and return the resulting index metadata rows.
Showing 289–312 of 323 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.