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.
Container With Most Water
Compute the maximum area between two vertical lines in an array of heights.
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.
Toeplitz Matrix Check
Write a function is_toeplitz(matrix) that checks if a 2D list is a Toeplitz matrix, where all elements on the same diagonal from top-left to bottom-right are identical.
Diagonal Traverse Matrix
Implement a function that returns all elements of a matrix in diagonal zigzag order.
Transpose Matrix In-Place
Implement a function that transposes a square matrix in-place and returns the transposed matrix.
Transpose 2D Array
Implement a function that returns the transpose of a rectangular 2D list.
Element-wise vector addition
Add equal-length numeric lists element-wise.
Scale a vector by scalar
Multiply every element by k.
Dot product of two vectors
Return sum of element-wise products.
Mean of a vector
Return arithmetic mean or 0.0 when empty.
Maximum element in vector
Return largest value or None when empty.
Minimum element in vector
Return smallest value or None when empty.
Clip vector to range
Clamp each value to [lo, hi].
Min-max normalize vector
Scale values to 0..1; equal values become all 0.0.
Sum each matrix row
Given rows, return each row sum.
Sum each matrix column
Return column totals for a rectangular matrix.
Showing 49–68 of 68 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.