Intersection of Two Lists
Given two lists, return a sorted list of unique elements that appear in both lists.
Union of Two Lists
Implement a function that combines two lists and returns only unique elements.
Difference of Two Lists
Write a function that returns items in list a that are not in list b, preserving order and duplicates.
Chunk list into groups
Implement a function that splits a list into sublists of a given size.
Zip Two Lists
Write a function that pairs elements from two lists by index, stopping at the shorter list.
Partition Array
Implement a function that finds a contiguous partition of a list into k groups, minimizing the maximum sum of the groups.
Rearrange Positives and Negatives
Write a function that rearranges a list in-place so all negative numbers come before non-negative numbers.
Wave sort array
Given a list of integers, reorder it into a wave pattern where elements alternate down-up, and return the new list.
Last occurrence index
Implement a function that returns the last index of a given value in a list, or -1 if the value is not present.
Counting Sort
Implement the counting sort algorithm to sort a list of non-negative integers in O(n + k) time.
Two Missing Numbers
Given a list of n-2 unique integers from 1 to n, find the two missing numbers efficiently.
Three Missing Numbers
Find the three missing numbers from a shuffled list containing all but three integers from 1 to n.
Image channel swap
Implement a function that swaps the red and blue channels of an RGB image.
Pad Array Edges
Write a function that pads a list with zeros on both ends.
Count Smaller Numbers
Given an integer list, return for each position how many later elements are smaller than it.
Sort array by parity
Given a list of integers, return a new list with all evens first and odds last, preserving original relative order.
Count Adjacent Pairs
Given a list of integers and a target, count adjacent pairs whose sum equals the target.
Cartesian Product Pairs
Create a function that returns the Cartesian product of two lists as a sorted list of lists.
Reorder list halves
Implement reorder_list(nums) that returns the first half followed by the reversed second half.
Sort List Merge Sort
Write a function that sorts a list of integers using the merge sort algorithm.
Rotate List Right by k
Implement a function that rotates a list to the right by k positions.
Convert Binary Number List
Given a list of bits (0s and 1s) in most-significant-first order, return the equivalent integer value.
Insertion Sort
Implement insertion sort that sorts a list in-place and returns the same list.
Intersection two lists length
Return the number of distinct elements that appear in both input lists.
Showing 73–96 of 273 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.