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
Math & Number Theory medium

Smith Number Check

Write a function to check if a number is a Smith number by comparing digit sums of the number and its prime factorization.

prime factors digit sum number theory
+20 pts 25m
Math & Number Theory easy

Partition function

Write a function that returns the number of ways to write a positive integer as a sum of positive integers (order irrelevant).

math recursion memoization
+12 pts 15m
Math & Number Theory easy

Deficient Number Check

Write is_deficient(n) that returns True if the sum of proper divisors is less than n.

math number-theory divisors
+8 pts 8m
Bit Manipulation easy

Subset XOR sum

Given a list of integers, compute the bitwise XOR of each non-empty subset and return the sum of those XOR totals.

xor bitwise subsets
+8 pts 10m
Dynamic Programming easy

House Robber

Given a list of house values, return the maximum sum you can rob without robbing two adjacent houses.

dynamic-programming arrays optimization
+10 pts 15m
Dynamic Programming easy

Triangle Minimum Path

Compute the minimum path sum from top to bottom of a triangle given as a list of lists.

dynamic-programming bottom-up arrays
+12 pts 20m
Dynamic Programming medium

Partition Equal Subset

Determine whether a given list of positive integers can be partitioned into two subsets with equal sum.

dynamic-programming subset-sum memoization
+30 pts 25m
Dynamic Programming medium

Target Sum Subsets

Write a function that counts the number of subsets of a list of positive integers that sum exactly to a target.

subset-sum dp counting
+25 pts 30m
Dynamic Programming medium

Coin Change Ways

Count the number of distinct combinations of coins that sum to a target amount.

dynamic programming coins counting
+30 pts 25m
Dynamic Programming medium

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.

dynamic-programming math optimization
+25 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

Minimum Falling Path Sum

Compute the minimum falling path sum in an n x n matrix by moving down or diagonally each step.

dynamic programming grid path sum
+25 pts 25m
Dynamic Programming medium

Count subsets with sum

Given a list of integers and a target sum, count how many subsets of the list sum to the target.

subset-sum dynamic-programming counting
+20 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 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

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
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 easy

Range Sum BST

Return the sum of all node values in a BST that lie within a given inclusive range [low, high].

bst tree recursion
+10 pts 15m
Recursion & Backtracking hard

Partition to k subsets

Determine if an array of positive integers can be partitioned into k subsets of equal sum using backtracking.

backtracking recursion partition
+40 pts 35m
Recursion & Backtracking medium

Partition Equal Subset Sum (Backtracking)

Write a function that uses backtracking to decide if a list of positive integers can be partitioned into two subsets with equal sum.

backtracking subset-sum partition
+25 pts 25m
Recursion & Backtracking medium

Combination Sum

Given a list of distinct positive integers and a target, return all unique combinations that sum to the target.

backtracking recursion combinations
+25 pts 30m
Greedy Algorithms hard

Patching Array

Given a sorted array of positive integers and a target n, find the minimum number of patches to make every number from 1 to n representable as a subset sum.

greedy arrays prefix-sums
+40 pts 30m
Binary Search medium

Binary Search on Answer: Find the Minimal Maximum Subarray Sum

Implement a function that finds the minimal possible maximum subarray sum when splitting an array into at most k contiguous subarrays.

binary-search arrays greedy
+25 pts 25m

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