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

Matrix Chain Multiplication

Given a list of matrix dimensions, compute the minimum multiplication cost using dynamic programming.

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

Target sum assignments

Given a list of integers and a target, count how many ways to assign + or - to each number so the total equals the target.

dynamic programming combinatorics arrays
+30 pts 25m
Dynamic Programming medium

Subset Sum Exists

Given a list of positive integers and a target sum, return whether some subset adds up exactly to the target.

subset sum dynamic programming knapsack
+25 pts 30m
Dynamic Programming easy

Tiling dominoes count

Given a 2 x n board, count the distinct tilings using 2 x 1 dominoes.

dynamic-programming fibonacci counting
+10 pts 15m
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 hard

Split Array Largest Sum

Minimize the largest sum among k contiguous subarrays using dynamic programming.

dynamic-programming binary-search arrays
+45 pts 40m
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
Dynamic Programming medium

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.

dynamic-programming matrix path
+20 pts 25m
Dynamic Programming medium

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.

dynamic-programming matrix grid
+30 pts 30m
Trees & Binary Trees easy

Binary Search Tree Class

Build a BinarySearchTree class and a sequence runner that executes a list of operations.

binary-search-tree classes traversal
+10 pts 15m
Trees & Binary Trees easy

Binary Tree Inorder Traversal

Implement an inorder traversal function that returns node values in left-root-right order.

binary-tree traversal recursion
+10 pts 15m
Trees & Binary Trees easy

Preorder Traversal

Implement a function that returns the preorder traversal values of a binary tree.

binary-tree traversal recursion
+10 pts 10m
Trees & Binary Trees easy

Postorder Traversal

Implement a function that returns the postorder traversal of a binary tree as a list of node values.

binary-tree traversal recursion
+10 pts 15m
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 easy

Minimum Depth of Tree

Given a binary tree, compute the minimum depth from the root to the nearest leaf node.

binary-tree depth traversal
+10 pts 15m
Trees & Binary Trees easy

Symmetric Tree Check

Write a function that checks whether a binary tree is symmetric (a mirror of itself).

binary-tree recursion mirror
+10 pts 15m
Trees & Binary Trees easy

Same Tree Check

Write a function that checks whether two binary trees are identical in structure and node values.

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

Lowest Common Ancestor in a Binary Tree

Implement a function to find the lowest common ancestor (LCA) of two nodes in a binary tree.

binary-tree dfs recursion
+30 pts 30m
Trees & Binary Trees medium

Sum Root to Leaf Numbers

Given the root of a binary tree, compute the total sum of all root-to-leaf numbers.

binary-tree dfs recursion
+25 pts 25m
Trees & Binary Trees medium

Binary tree left side view

Given a binary tree, return the leftmost node's value at each depth, from top to bottom.

binary-tree levels bfs
+20 pts 20m
Trees & Binary Trees medium

Vertical Order Traversal

Compute the vertical order traversal of a binary tree, grouping nodes by column and row.

binary-tree bfs dictionary
+20 pts 25m
Trees & Binary Trees medium

Delete Node in BST

Implement a function that deletes a key from a binary search tree and returns the new root.

binary-search-tree tree-traversal recursion
+20 pts 20m
Trees & Binary Trees easy

Insert into BST

Implement insertion into a Binary Search Tree while maintaining BST properties.

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

Trim BST to range

Implement a function to trim a BST to only retain nodes with values in a given inclusive range.

bst recursion tree-pruning
+25 pts 25m

Showing 601–624 of 925 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.