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
Recursion & Backtracking easy

Permutations

Write a function that returns every permutation of the elements in the input list.

recursion backtracking permutations
+10 pts 15m
Recursion & Backtracking medium

Permutations II

Return all distinct permutations of a list of integers that may include duplicates.

permutations backtracking deduplication
+25 pts 25m
Recursion & Backtracking medium

Subsets

Return all subsets (the power set) of a list of distinct integers.

recursion backtracking subsets
+20 pts 25m
Recursion & Backtracking medium

Subsets II

Given a collection of integers that might contain duplicates, return all possible unique subsets.

subsets backtracking deduplication
+25 pts 30m
Recursion & Backtracking medium

N-Queens Count

Count the number of distinct valid placements of n non-attacking queens on an n×n chessboard.

backtracking recursion n-queens
+25 pts 30m
Recursion & Backtracking medium

Word Search Backtrack

Determine if a given word exists in a 2D board by tracing adjacent cells without reusing any cell.

backtracking matrix dfs
+25 pts 25m
Recursion & Backtracking medium

Palindrome Partitioning

Given a string s, return all possible palindrome partitioning of s.

backtracking recursion palindrome
+25 pts 30m
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 hard

Remove invalid parentheses

Given a string with parentheses and letters, return all valid strings after removing the minimum number of invalid parentheses.

backtracking parentheses string
+45 pts 40m
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

Letter Tile Possibilities

Given a string of letter tiles, count the number of distinct non-empty sequences that can be formed using any non-empty subset in any order.

backtracking counting strings
+25 pts 25m
Recursion & Backtracking easy

Power set from set

Write a function to return the power set of a given list of distinct elements.

recursion subsets combinations
+8 pts 12m
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
Recursion & Backtracking medium

Beautiful Arrangement Count

Count the number of permutations of 1..n such that for every index i, either i is divisible by the number at that position or the number is divisible by i.

recursion backtracking permutations
+30 pts 30m
Recursion & Backtracking medium

Rat in a Maze

Count the number of distinct paths a rat can take from top-left to bottom-right in a binary grid, moving down or right and avoiding walls.

backtracking recursion maze
+25 pts 30m
Recursion & Backtracking hard

Hamiltonian Cycle Backtrack

Implement a backtracking algorithm to find a Hamiltonian cycle in an undirected graph.

backtracking graph hamiltonian
+45 pts 40m
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 medium

Candy Distribution

Compute the minimum total candies needed so that every child gets at least one and children with higher ratings than neighbors get more candies.

greedy arrays optimization
+20 pts 20m
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 easy

Lemonade Change

Simulate a lemonade stand and decide if you can provide change for each customer using only $5, $10, and $20 bills.

greedy simulation counting
+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 hard

Remove K Digits to Form the Smallest Number

Given a non-negative integer as a string, remove exactly k digits to form the smallest possible integer without leading zeros.

greedy stack string
+45 pts 35m
Greedy Algorithms medium

Meeting Rooms Minimum

Given a list of meeting time intervals, compute the minimum number of conference rooms required.

greedy intervals sorting
+30 pts 25m
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

Showing 673–696 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.