Longest Repeating Character Replacement
Given a string and an integer k, return the length of the longest substring that can be made of identical characters after at most k replacements.
Daily Temperatures
Given a list of daily temperatures, return for each day how many days until a warmer temperature appears.
Buildings with ocean view
Given building heights, return sorted indices of buildings that have a clear view of the ocean to their right.
Asteroid Collision
Simulate asteroid collisions with a stack and return the remaining asteroids in original order.
Top K Frequent Elements
Given an integer array and a number k, return the k most frequent elements using a heap-based approach.
Kth Largest Element in an Array (Heap Edition)
Implement a function that returns the kth largest element in an unsorted integer array using a heap.
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.
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.
Sliding Window Maximum using Heap
Given an array of integers and a window size k, return an array of maximums for each contiguous subarray of length k.
Split list at index
Return prefix and suffix tuples at index k.
Spiral Matrix Order
Given a 2D matrix, return all elements in clockwise spiral order starting from the top-left.
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.
Spiral Matrix Traversal
Implement a function that returns the elements of a 2D matrix in clockwise spiral order.
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.
Easter Date Calculator
Implement a function that returns the date of Easter Sunday for a given year using the Gregorian computus algorithm.
Index Creation Query
Create an in-memory SQLite database, execute CREATE INDEX statements, and return the resulting index metadata rows.
Nth Highest Salary
Write a Python function using SQLite to return the Nth highest distinct salary from an employee table.
Square each element
Return element-wise squares.
Absolute value per element
Return element-wise absolute values.
Keep positive elements
Return values strictly greater than zero.
Prefix sum vector
Return running totals for each prefix of the vector.
Reverse vector order
Return elements in opposite order.
L2 norm of vector
Return Euclidean length.
Showing 73–96 of 96 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.