Top K Frequent Words
Given a list of words, return the k most frequent words sorted by frequency (descending) and then alphabetically.
Sort by frequency
Sort a list by element frequency descending, with ties broken by order of first occurrence.
Frequency sort descending
Write a function that sorts a list by frequency descending while preserving original order for ties.
Bubble Sort
Implement bubble sort that sorts a list of numbers in ascending order.
Selection Sort Implementation
Implement selection sort to sort a list of numbers in ascending order.
Shell Sort
Implement Shell sort, an in-place comparison sort that generalizes insertion sort, using a gap sequence that shrinks by half each pass.
Merge Two Sorted Lists
Write a function that merges two sorted lists into a single sorted list.
Argsort Indices
Implement a function that returns the indices that would sort a list of integers, with ties broken by original order.
Shortest Unsorted Continuous Subarray
Given an array of integers, return the length of the shortest contiguous subarray whose sorting makes the whole array sorted.
Assign Cookies
Given child greed factors and cookie sizes, return the maximum number of content children.
Maximize units on truck
Given box types with count and units per box, maximize total units loaded onto a truck.
Maximum Ice Cream Bars
Given costs of ice cream bars and coins, return the maximum number you can buy.
Squares of Sorted Array
Implement a function that returns a sorted list of squares for a given non-decreasing integer array.
Showing 25–37 of 37 challenges · easy
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.