Power set from set
Write a function to return the power set of a given list of distinct elements.
Combination Sum
Given a list of distinct positive integers and a target, return all unique combinations that sum to the target.
Assign Cookies
Given child greed factors and cookie sizes, return the maximum number of content children.
Partition Labels
Partition a string into maximal parts where each character appears in only one part, returning part lengths.
Boats to Save People
Given a list of people weights and a boat's weight limit, return the minimum number of boats required.
Maximum Ice Cream Bars
Given costs of ice cream bars and coins, return the maximum number you can buy.
Non-overlapping Intervals
Given a list of intervals, return the minimum number of intervals to remove to make the rest non-overlapping.
Search Insert Position
Return the index where a target should be inserted into a sorted list to maintain order.
Kth Missing Positive
Given a strictly increasing array and an integer k, return the k-th positive integer that is missing from the array.
Single Element in Sorted Array
Given a sorted array where every element appears exactly twice except one which appears once, return the single element.
Upper Bound Binary Search
Write a function that returns the index of the first element greater than a target in a sorted list.
Find Indices of Target in Sorted List
Given a sorted list and a target, return the indices of its first and last occurrence, or [-1, -1] if absent.
Kth Smallest in Sorted Matrix
Implement kth_smallest(matrix, k) to return the kth smallest element in a row- and column-sorted square matrix.
Book Allocation: Minimize Maximum Pages
Implement a function that returns the minimized maximum pages when allocating a list of books to k students.
Nth Magical Number
Given three integers n, a, b, return the nth positive integer that is divisible by either a or b.
Find k Closest Elements to Target
Return exactly k elements from a sorted list that are closest to a given target, preserving order.
Longest Substring Without Repeating Characters
Implement a function that returns the length of the longest substring without repeating characters.
Reduce array to zero
Given an array of non-negative integers, each operation chooses two indices and subtracts 1 from each if both are positive. Return the minimum number of operations to reduce the array to all zeros, or -1 if impossible.
Two Sum Sorted
Given a 1-indexed sorted array and a target, return the two indices that add up to the target.
Three Sum
Given an array of integers, return all unique triplets that sum to zero.
Closest Three Sum
Given an array of integers and a target, return the sum of three numbers that is closest to the target.
Squares of Sorted Array
Implement a function that returns a sorted list of squares for a given non-decreasing integer array.
Interval List Intersections
Given two lists of sorted, disjoint intervals, return the list of intersections between them.
Minimum Size Subarray Sum
Given an array of positive integers, return the minimal length of a contiguous subarray with sum at least target, or 0 if none exists.
Showing 265–288 of 371 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
- Pick a category — basics, algorithms, strings, and more
- Open a challenge, read the statement, and edit the starter code
- 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.