Pair with difference K
Count unordered index pairs with absolute difference exactly K, handling duplicates correctly.
Binary search
Return the index of target in a sorted list, or -1 if not present.
Index of peak element
Implement a function that returns the index of any peak element in a given integer array.
Find Peak Element
Implement a function that returns the index of any peak element in an integer array.
Previous Smaller Element
Find the nearest previous index with a smaller value for every element in an array.
Exponential Search
Implement exponential search to find any valid index of a target in a sorted list.
Find Peak Index
Given a list of integers, return the index of any peak element where the value is not smaller than its neighbors.
Peak Element in Array
Implement a function that returns the index of any peak element in a list of integers.
Jump Search
Implement the jump search algorithm to locate a target in a sorted list, returning its index or -1.
Find Rightmost Set Bit
Implement a function that returns the 1-indexed position of the rightmost set bit of a positive integer, or 0 if none.
Set kth Bit
Implement a function that sets the kth bit (0-indexed) of a non-negative integer to 1 and returns the result.
Toggle kth Bit
Implement a function that toggles the kth bit of a non-negative integer (0-indexed from the least significant bit) and returns the new integer.
Beautiful Arrangement Count
Count the number of permutations of 1..n such that for every index i, either i is divisible by the number at that position or the number is divisible by i.
Gas Station Circuit
Given gas and cost arrays for a circular route, determine the starting gas station index that allows a full loop, or -1 if none exists.
Jump Game Reachable
Given an array of non-negative integers where each element is the maximum jump length, determine if you can reach the last index.
Search Insert Position
Return the index where a target should be inserted into a sorted list to maintain order.
Lower Bound Binary Search
Implement binary search to find the first index where an element is not less than a given target.
Upper Bound Binary Search
Write a function that returns the index of the first element greater than a target in a sorted list.
Two Sum Sorted
Given a 1-indexed sorted array and a target, return the two indices that add up to the target.
Value at index n
Return the value at zero-based index n or None if out of range.
Middle node index
Return the floor middle index for a non-empty list.
Split list at index
Return prefix and suffix tuples at index k.
Insert value at index
Insert x at index i in a new list.
Index Creation Query
Create an in-memory SQLite database, execute CREATE INDEX statements, and return the resulting index metadata rows.
Showing 25–48 of 49 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.