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
Lists & Arrays easy

Running Total Window

Implement a function that returns a list of running totals, resetting to zero after each positive sum.

running-total sliding-window arrays
+8 pts 10m
Lists & Arrays easy

Normalize Array to Zero-One Range

Implement a function that normalizes a list of numbers to the range [0,1] using min-max scaling.

arrays normalization scaling
+8 pts 12m
Lists & Arrays easy

Linear Interpolation Array

Given an array with some None values, replace them by linear interpolation between the nearest known values.

arrays interpolation math
+8 pts 12m
Lists & Arrays medium

Convolve 1D Signal

Write a function that computes the 1D convolution of two lists in 'full' mode.

convolution arrays sliding-window
+20 pts 20m
Dicts & Sets medium

Subarray sum equals K

Count the number of contiguous subarrays whose sum equals k.

prefix-sum dict arrays
+28 pts 25m
Dicts & Sets easy

Longest Harmonious Subsequence

Given a list of integers, find the length of the longest harmonious subsequence where the difference between maximum and minimum values is exactly 1.

hash-map counting subsequence
+10 pts 15m
Data Structures & Algorithms easy

Index of peak element

Implement a function that returns the index of any peak element in a given integer array.

arrays search peak
+10 pts 15m
Data Structures & Algorithms easy

Count pairs with given difference

Count how many unordered pairs in a list have a given absolute difference using an efficient approach.

hash map counting arrays
+12 pts 15m
Data Structures & Algorithms medium

Find Peak Element

Implement a function that returns the index of any peak element in an integer array.

arrays search binary-search
+20 pts 25m
Data Structures & Algorithms easy

Previous Smaller Element

Find the nearest previous index with a smaller value for every element in an array.

arrays stack monotonic-stack
+10 pts 15m
Data Structures & Algorithms hard

Median of Two Sorted Arrays

Given two sorted arrays, return the median of the combined sorted array in O(log(min(n,m))) time.

median binary search arrays
+45 pts 40m
Data Structures & Algorithms easy

Pascal Triangle Row

Given a non-negative integer n, return the nth row of Pascal's triangle as a list of integers.

math combinatorics arrays
+10 pts 15m
Data Structures & Algorithms easy

Bubble Sort

Implement bubble sort that sorts a list of numbers in ascending order.

sorting arrays algorithms
+8 pts 12m
Data Structures & Algorithms easy

Find Peak Index

Given a list of integers, return the index of any peak element where the value is not smaller than its neighbors.

arrays linear-scan peak
+10 pts 15m
Data Structures & Algorithms hard

Count of Range Sum

Count contiguous subarrays whose sum lies in a given inclusive range using an efficient divide-and-conquer algorithm.

prefix-sum merge-sort divide-conquer
+35 pts 40m
Data Structures & Algorithms medium

K Closest Elements

Implement a function to return the k closest elements to a target in a sorted array.

arrays binary-search sorting
+25 pts 25m
Data Structures & Algorithms medium

Next greater element II

For each element in a circular array, find the next greater element (NGE) to its right, wrapping around.

arrays stack monotonic stack
+20 pts 20m
Data Structures & Algorithms medium

Merge time intervals

Given a list of time intervals, merge all overlapping intervals and return the merged intervals.

intervals sorting arrays
+20 pts 20m
Data Structures & Algorithms easy

Consecutive available seats

Given a list of seat statuses, return the length of the longest consecutive run of available (0) seats.

arrays sliding-window greedy
+10 pts 15m
Data Structures & Algorithms medium

Delete duplicates sorted II

Given a sorted list, remove duplicates in place so each element appears at most twice, returning the new length.

arrays two-pointers in-place
+20 pts 20m
Data Structures & Algorithms medium

Arithmetic Slices Count

Given a list of integers, count how many contiguous subarrays of length at least 3 form an arithmetic sequence.

arrays arithmetic counting
+15 pts 20m
Math & Number Theory medium

Correlation Coefficient

Write a pure-Python function that computes the Pearson correlation coefficient between two lists of numbers.

statistics math arrays
+15 pts 15m
Bit Manipulation easy

Single Number XOR

Given a non-empty list of integers where every element appears twice except one, return the single number using XOR.

xor bit-manipulation arrays
+10 pts 12m
Bit Manipulation easy

Missing Number XOR

Given a list of n distinct numbers from 0 to n with one missing, use XOR to find and return the missing number.

xor bitwise arrays
+10 pts 15m

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