Postorder Traversal
Implement a function that returns the postorder traversal of a binary tree as a list of node values.
Maximum depth of tree
Implement max_depth(root) to return the maximum depth of a binary tree.
Range Sum BST
Return the sum of all node values in a BST that lie within a given inclusive range [low, high].
Find the Town Judge
Given n people and a trust array, return the town judge or -1.
Permutation Generator
Write a function that returns all permutations of a list of distinct integers.
Permutations
Write a function that returns every permutation of the elements in the input list.
Power set from set
Write a function to return the power set of a given list of distinct elements.
Assign Cookies
Given child greed factors and cookie sizes, return the maximum number of content children.
Maximum Ice Cream Bars
Given costs of ice cream bars and coins, return the maximum number you can buy.
Search Insert Position
Return the index where a target should be inserted into a sorted list to maintain order.
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.
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.
Squares of Sorted Array
Implement a function that returns a sorted list of squares for a given non-decreasing integer array.
Next Greater Element
Return a list where each position holds the next greater element to the right, or -1 if none exists.
Last Stone Weight
Given an array of stone weights, repeatedly smash the two heaviest stones and return the last remaining weight or 0.
Count nodes in a linked list
Return how many values appear in the list (one per node).
Read the head node value
Return the first value or None when the list is empty.
Read the tail node value
Return the last value or None when the list is empty.
Reverse a linked list copy
Return a new list with node values in reverse order without mutating the input.
Concatenate two linked lists
Append the second list's nodes after the first and return a new list.
Value at index n
Return the value at zero-based index n or None if out of range.
Showing 193–216 of 255 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.