Boats to Save People
Given a list of people weights and a boat's weight limit, return the minimum number of boats required.
Minimum Number of Arrows to Burst Balloons
Given balloon intervals, find the minimum number of arrows to burst all balloons by merging overlaps.
Queue Reconstruction by Height
Given shuffled pairs of (height, number_of_taller_people_in_front), reconstruct the original queue order.
Non-overlapping Intervals
Given a list of intervals, return the minimum number of intervals to remove to make the rest non-overlapping.
Max events attended
Given a list of events with start and end times, find the maximum number of non-overlapping events you can attend.
Nth Magical Number
Given three integers n, a, b, return the nth positive integer that is divisible by either a or b.
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.
Character Replacement Window
Given a string and a number k, find the length of the longest substring that can be made uniform by replacing at most k characters.
Count Nice Subarrays
Given an array of integers, count the number of contiguous subarrays that contain exactly k odd numbers.
Closest Three Sum
Given an array of integers and a target, return the sum of three numbers that is closest to the target.
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.
Binary Subarray with Sum
Given a binary list and a goal sum, count the number of subarrays that add up to that goal.
Boats to Save People – Two Pointer
Implement a function that returns the minimum number of boats needed to rescue everyone, given a weight limit and each boat carrying at most two people.
Count Nice Subarrays
Count subarrays that contain exactly k odd numbers.
Remove K Digits Stack
Remove k digits from a non-negative integer string to produce the smallest possible number using a stack-based approach.
Top K Frequent Elements
Given an integer array and a number k, return the k most frequent elements using a heap-based approach.
Top K Frequent Elements
Given a list of integers and a number k, return the k most frequent elements in descending order of frequency, with ties broken by larger value.
Task Scheduler Heap
Given a list of tasks and a cooldown, find the minimum number of CPU intervals needed to schedule all tasks without violating the cooldown.
Meeting Rooms II with Heaps
Given a list of meeting intervals, compute the minimum number of rooms required using a heap-based approach.
Number of Islands
Given a 2D grid of '1' (land) and '0' (water), count the number of islands surrounded by water.
Number of Islands in a Matrix
Count the number of distinct islands (connected groups of 1s) in a 2D binary matrix.
Regions Cut by Slashes
Given a grid of slashes, count the number of connected regions formed by the slashes and the grid borders.
Julian Day Number Converter
Implement two functions to convert between Gregorian calendar dates and Julian Day Numbers using a standard formula.
Extract JSON-like numbers
Parse a simplified JSON-like string without using the json module and sum all numbers found in it.
Showing 49–72 of 72 challenges · medium
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.