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.
Days in month
Write a function that returns the number of days in a given month and year, correctly handling leap years.
Days Between Dates
Write a function that returns the number of days between two given dates.
Add Days to Date
Given a date in YYYY-MM-DD format and an integer number of days, return the resulting date in the same format.
Business days between
Calculate the number of business days (Mon-Fri) between two dates, inclusive of both endpoints.
Week Number ISO
Given a date, return its ISO 8601 week number (1–53) without using datetime.isocalendar().
Duration Human Readable
Write a function that turns a number of seconds into a human-readable duration like '2 hours, 1 minute'.
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 169–184 of 184 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.