Level Order Traversal
Implement a function that performs a level order traversal of a binary tree and returns node values as a list of lists.
Delete duplicates sorted II
Given a sorted list, remove duplicates in place so each element appears at most twice, returning the new length.
Accounts Merge
Given a list of accounts, merge those that share any email and return sorted accounts.
Strobogrammatic number II
Given a positive integer n, return all strobogrammatic numbers of length n in ascending order.
Memoize with TTL
Implement a decorator that caches function results for a limited time, returning cached values within the TTL and recomputing after expiry.
Zeller Congruence Weekday
Implement a function that returns the weekday name for a given date using Zeller's congruence.
Extended Euclidean Algorithm
Implement the extended Euclidean algorithm to return (gcd, x, y) such that ax + by = gcd(a, b).
Polynomial Fit Coefficients
Implement a function that returns the coefficients of the best-fit quadratic polynomial for given points.
Bitwise AND of a Range
Given a range [a, b], return the bitwise AND of all integers in that inclusive range without iterating over all numbers.
Maximum XOR Pair
Implement max_xor_pair(nums) that returns the maximum XOR value obtainable by pairing any two numbers in the given list.
Kadane Variant: Maximum Product Subarray
Implement max_product_subarray(nums) that returns the maximum product of any contiguous subarray.
Perfect Squares Sum
Given a positive integer n, return the least number of perfect squares (e.g., 1, 4, 9, 16, ...) that sum to n.
Longest Arithmetic Subsequence
Given a list of integers, return the length of the longest arithmetic subsequence (constant difference) within it.
Ugly Number II
Given an integer n, return the nth ugly number using an efficient dynamic programming approach.
Shortest Common Supersequence
Given two strings, return any shortest supersequence that contains both as subsequences.
Subset Sum Exists
Given a list of positive integers and a target sum, return whether some subset adds up exactly to the target.
Binary tree left side view
Given a binary tree, return the leftmost node's value at each depth, from top to bottom.
Delete Node in BST
Implement a function that deletes a key from a binary search tree and returns the new root.
Kth Smallest in BST
Implement a function that returns the k-th smallest value in a binary search tree.
Count Complete Tree Nodes
Given a complete binary tree, return its node count faster than O(n) time.
Zigzag Level Order Traversal
Implement a function that returns the zigzag level-order traversal of a binary tree.
Articulation Points
Implement a function that returns the articulation points of an undirected graph.
Bridges in Graph
Implement a function that returns all bridges in an undirected graph.
Course Schedule Can Finish
Given numCourses and prerequisites, return whether all courses can be finished without cyclic dependencies.
Showing 25–48 of 96 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.