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

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

Jump Game Reachable

Given an array of non-negative integers where each element is the maximum jump length, determine if you can reach the last index.

greedy arrays jump-game
+20 pts 20m
Greedy Algorithms medium

Max events attended

Given a list of events with start and end times, find the maximum number of non-overlapping events you can attend.

greedy interval-scheduling sorting
+20 pts 20m
Binary Search medium

Ternary Search

Implement ternary search to locate the maximum of a discrete unimodal function.

ternary-search binary-search unimodal
+25 pts 30m
Binary Search medium

Maximum Running Time of n Computers

Use binary search to maximize the running time for n computers with batteries.

binary-search greedy array
+30 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
Binary Search medium

Book Allocation: Minimize Maximum Pages

Implement a function that returns the minimized maximum pages when allocating a list of books to k students.

binary-search greedy arrays
+30 pts 30m
Binary Search medium

Minimum Limit of Balls in a Bag

Given an array of bag sizes and a number of allowed splits, find the minimum possible maximum bag size.

binary-search arrays optimization
+25 pts 25m
Two Pointers & Sliding Window medium

Container With Most Water

Given an array of heights, find the maximum area between two vertical lines that can hold water.

two-pointers array maximization
+20 pts 25m
Two Pointers & Sliding Window easy

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.

arrays sliding-window profit
+10 pts 15m
Two Pointers & Sliding Window medium

Fruit into Baskets

Given an array of integers representing fruit types, return the maximum number of fruits you can collect in a contiguous subarray with at most two distinct types.

sliding-window two-pointers hash-map
+25 pts 25m
Two Pointers & Sliding Window easy

Container With Most Water

Compute the maximum area between two vertical lines in an array of heights.

two-pointers array area-calculation
+15 pts 15m
Heaps & Priority Queues medium

Sliding Window Maximum using Heap

Given an array of integers and a window size k, return an array of maximums for each contiguous subarray of length k.

heap sliding-window deque
+20 pts 20m
Heaps & Priority Queues medium

Maximum Average Pass Ratio

Given class pass/total counts and extra students, maximize the average pass ratio by assigning extra students optimally.

heap priority-queue greedy
+25 pts 25m
Linked Lists easy

Maximum node value

Return the largest integer or None when empty.

linked-list lists pointers
+10 pts 12m
Matrix & 2D Arrays medium

Max Area of Island

Given a 2D grid of 0s and 1s, find the maximum area of a connected group of 1s.

grid dfs connected-components
+20 pts 25m
Numpy & Vectorized Computing easy

Maximum element in vector

Return largest value or None when empty.

vectors arrays numpy-style
+10 pts 12m
Numpy & Vectorized Computing hard

Index of maximum value

Return index of largest value (first on tie).

vectors arrays numpy-style
+35 pts 30m

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