Practice Arena

Python Coding Challenges

Write real Python in the browser. Instant feedback. From beginner to expert.

925 challenges 556 easy 323 medium 46 hard
Dynamic Programming medium

House Robber Circular

Solve the House Robber problem with houses arranged in a circle.

dynamic-programming arrays circular
+25 pts 30m
Dynamic Programming medium

Maximal square

Given a 2D binary matrix of 0s and 1s, compute the area of the largest square containing only 1s.

dynamic-programming matrix maximal-square
+30 pts 30m
Dynamic Programming medium

0/1 Knapsack

Implement the classic 0/1 Knapsack dynamic programming solution to maximize value under a weight capacity.

dynamic-programming knapsack optimization
+30 pts 25m
Dynamic Programming medium

Unbounded Knapsack

Given item weights and values with unlimited copies, find the maximum total value that fits in a knapsack capacity.

dynamic-programming knapsack optimization
+30 pts 25m
Dynamic Programming medium

Integer Break Product

Given a positive integer n, break it into at least two positive integers that sum to n and maximize their product.

integer-break dynamic-programming max-product
+25 pts 30m
Dynamic Programming medium

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.

dynamic-programming state-machine stocks
+25 pts 25m
Dynamic Programming hard

Create Maximum Number

Given two arrays of digits and an integer k, merge them to form the largest number of length k.

arrays greedy dynamic-programming
+40 pts 35m
Dynamic Programming hard

Cherry Pickup Maximum

Given a grid with cherries, find the maximum cherries you can collect using two paths from top-left to bottom-right.

dynamic-programming 2d-grid grid-walk
+40 pts 35m
Dynamic Programming medium

Maximal square matrix

Given a 2D binary matrix of 0s and 1s, find the side length of the largest square containing only 1s.

dynamic-programming matrix maximum-square
+25 pts 30m
Dynamic Programming medium

Delete and Earn

Given an array of integers, find the maximum points you can earn by repeatedly deleting a number and all its adjacent values.

dynamic-programming array hash-map
+30 pts 25m
Dynamic Programming medium

Maximal rectangle in matrix

Given a matrix of 0s and 1s, compute the area of the largest rectangle consisting only of 1s.

dynamic programming binary matrix histogram
+25 pts 30m
Trees & Binary Trees easy

Maximum depth of tree

Implement max_depth(root) to return the maximum depth of a binary tree.

binary-tree recursion depth
+10 pts 15m
Trees & Binary Trees medium

Maximum Width of a Binary Tree

Given the root of a binary tree, compute its maximum width (the maximum number of nodes in any level, counting null positions).

binary-tree breadth-first-search queue
+25 pts 25m
Graphs & Graph Algorithms hard

Minimum Cut

Given an undirected graph in adjacency-list form, return the size of the minimum edge cut that disconnects the graph.

graphs max-flow min-cut
+40 pts 35m
Graphs & Graph Algorithms hard

Swim in Rising Water

Find the minimum time needed to swim from the top-left to the bottom-right of a grid where water level rises and you can only move to cells with elevation ≤ current time.

graph minimax priority-queue
+30 pts 20m
Graphs & Graph Algorithms medium

Most stones removed

Given stone coordinates on a grid, find the maximum number of stones that can be removed while every stone shares a row or column with another remaining stone.

graphs dfs union-find
+30 pts 30m
Greedy Algorithms easy

Stock Buy Sell Once

Given daily stock prices, compute the maximum profit you can achieve from buying once and selling once later.

array profit max
+10 pts 15m
Greedy Algorithms easy

Assign Cookies

Given child greed factors and cookie sizes, return the maximum number of content children.

greedy sorting two-pointers
+10 pts 15m
Greedy Algorithms medium

Partition Labels

Partition a string into maximal parts where each character appears in only one part, returning part lengths.

greedy string hashmap
+20 pts 20m
Greedy Algorithms easy

Maximize units on truck

Given box types with count and units per box, maximize total units loaded onto a truck.

greedy sorting capacity
+10 pts 15m
Greedy Algorithms medium

Bag of Tokens Score

Given tokens with values and initial power, determine the maximum score achievable by selling tokens for power or buying tokens for score.

greedy two-pointers sorting
+30 pts 30m
Greedy Algorithms easy

Maximum Ice Cream Bars

Given costs of ice cream bars and coins, return the maximum number you can buy.

greedy sorting array
+10 pts 15m
Greedy Algorithms medium

Painter Partition Problem

Given board lengths and k painters, find the minimum possible maximum total length a painter must paint.

binary-search greedy array-partitioning
+20 pts 25m
Greedy Algorithms medium

IPO Maximize Capital

Given project profits and capital requirements, choose at most k projects to maximize final capital.

greedy heap sorting
+25 pts 25m

Showing 25–48 of 68 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

  1. Pick a category — basics, algorithms, strings, and more
  2. Open a challenge, read the statement, and edit the starter code
  3. 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.