Min of three numbers
Write a function that returns the minimum of three integers.
Seconds to Hours Minutes Seconds
Convert total seconds into a zero-padded HH:MM:SS format.
Minutes to Hours: Time Conversion Helper
Write a function that converts minutes into a human-readable 'Xh Ym' string, with special cases for zero and whole hours.
Find Minimum Value
Write a function that returns the minimum integer from a given list.
Range of values
Calculate the range (max minus min) of a list of numbers. Empty list returns 0.
Is pangram
Write a function that determines whether a given string is a pangram, ignoring case and non-letter characters.
Is isogram
Implement a function that determines whether a string is an isogram (no repeated letters, case-insensitive).
Is rotation of another string
Write a function to determine if one string is a rotation of another string.
Hamming Distance
Implement a function that computes the Hamming distance between two strings of equal length.
Average excluding min and max
Return the average of a list after discarding the lowest and highest elements, handling edge cases.
Partition Array
Implement a function that finds a contiguous partition of a list into k groups, minimizing the maximum sum of the groups.
Merge dicts summing values
Write a function that merges two dictionaries by summing values for duplicated keys.
Count Pairs with Sum
Implement a function that counts the number of distinct pairs in a list summing to a target.
Ransom Note Builder
Given two strings, determine if the ransom note can be formed from the words in the magazine.
Class Method Factory
Create a class method factory that dynamically adds methods to a class based on a mapping of names to behaviors.
Coin change (DP)
Find the minimum number of coins to make exactly the target amount.
Median of Two Sorted Arrays
Given two sorted arrays, return the median of the combined sorted array in O(log(min(n,m))) time.
Decode Ways
Count the number of ways to decode a numeric string into letters using the mapping A=1 to Z=26.
Redundant Connection
Given a list of edges forming a tree plus one extra edge, return the edge that appears last in the input and creates a cycle.
Timing Decorator
Implement a decorator that prints the execution time of a function.
Context Manager Class
Implement a context manager class that measures execution time and sets duration, with None if an exception occurred.
Profile time decorator
Create a decorator that tracks how many times a function is called and its cumulative execution time.
Timer Context Manager
Implement a context manager that measures execution time of a with block and stores it.
Context Decorator Dual
Implement a timing decorator and a context manager that both record elapsed time in seconds.
Validate phone number
Write a function that uses regular expressions to determine if a given string is a valid US phone number.
Catalan number
Implement a function that returns the nth Catalan number using dynamic programming.
Stirling number
Implement a function to compute Stirling numbers of the second kind S(n,k).
Lucas Sequence
Implement a function to compute the n-th Lucas number using iteration or recursion with memoization.
Add without plus
Implement a function that adds two integers using only bitwise operations, no arithmetic plus or minus.
Levenshtein Distance
Implement the classic Levenshtein distance algorithm to measure string similarity.
Max Profit from Selling Twice
Compute the maximum profit that can be achieved by completing at most two buy-sell transactions on a given price array.
Bell number
Implement a function to compute the Bell number B(n) using dynamic programming.
Min cost climbing stairs
Compute the minimum total cost to reach the top of a staircase, given you can climb 1 or 2 steps at a time.
House Robber
Given a list of house values, return the maximum sum you can rob without robbing two adjacent houses.
House Robber Circular
Solve the House Robber problem with houses arranged in a circle.
Unique Paths in a Grid
Count the number of unique paths from the top-left corner to the bottom-right corner of a grid, moving only right and down.
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.
Triangle Minimum Path
Compute the minimum path sum from top to bottom of a triangle given as a list of lists.
Maximal square
Given a 2D binary matrix of 0s and 1s, compute the area of the largest square containing only 1s.
Longest Common Subsequence
Given two strings, compute the length of the longest subsequence common to both.
Longest Palindromic Subsequence
Compute the length of the longest palindromic subsequence in a given string.
Edit Distance (Levenshtein Distance)
Implement the classic edit distance algorithm to find the minimum number of single-character edits required to transform one string into another.
0/1 Knapsack
Implement the classic 0/1 Knapsack dynamic programming solution to maximize value under a weight capacity.
Unbounded Knapsack
Given item weights and values with unlimited copies, find the maximum total value that fits in a knapsack capacity.
Partition Equal Subset
Determine whether a given list of positive integers can be partitioned into two subsets with equal sum.
Coin Change Minimum
Given coin denominations and a target amount, compute the minimum number of coins needed or -1 if impossible.
Coin Change Ways
Count the number of distinct combinations of coins that sum to a target amount.
Perfect Squares Sum
Given a positive integer n, return the least number of perfect squares (e.g., 1, 4, 9, 16, ...) that sum to n.
Integer Break Product
Given a positive integer n, break it into at least two positive integers that sum to n and maximize their product.
Word Break DP
Implement a function to check if a string can be segmented into space-separated dictionary words.
Palindrome Partitioning Minimum Cuts
Given a string, return the minimum number of cuts needed such that every substring in the partition is a palindrome.
Egg Drop Puzzle
Given k eggs and n floors, compute the minimum number of attempts required in the worst case to find the highest safe floor.
Paint House Colors
Given a cost matrix, compute the minimum total cost to paint all houses with no two adjacent houses having the same color.
Buy Sell Stock with Cooldown (DP)
Given daily stock prices, compute the maximum profit you can achieve if you must wait one day after selling before buying again.
Minimum Depth of Tree
Given a binary tree, compute the minimum depth from the root to the nearest leaf node.
Minimum Cut
Given an undirected graph in adjacency-list form, return the size of the minimum edge cut that disconnects the graph.
Graph Coloring
Given an undirected graph, determine if it can be colored with two colors such that adjacent vertices have different colors.
Graph Valid Tree
Determine if n nodes and an edge list form a valid tree (connected and acyclic).
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.
Best Time to Buy and Sell Stock
Given a list of daily stock prices, determine the maximum profit achievable by buying on one day and selling on a later day.
Minimum Window Substring
Implement a sliding window algorithm to find the minimum window substring containing all characters of a given pattern.
Permutation in String
Determine if any permutation of a shorter string appears as a contiguous substring in a longer string using an efficient sliding window.
Min Heap Class
Build a MinHeap class with push, pop, peek, and size methods that maintain a valid min-heap.
Valid Sudoku Board
Determine if a 9x9 Sudoku board is valid by checking rows, columns, and 3x3 sub-boxes.
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.
Showing 65 challenges
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.