Container With Most Water
Compute the maximum area between two vertical lines in an array of heights.
Trapping Rain Water (Two Pointers)
Given an array of non-negative integers representing elevation heights, compute how much water can be trapped after rain.
Sliding Window Median
Given a list of integers and a positive window size k, return the median of each sliding window of length k.
Four Sum
Find all unique quadruplets in an array that sum to a given target.
Longest Repeating Character Replacement
Given a string and an integer k, return the length of the longest substring that can be made of identical characters after at most k replacements.
Count Nice Subarrays
Count subarrays that contain exactly k odd numbers.
Showing 25–30 of 30 challenges · Two Pointers & Sliding Window
Two Pointers & Sliding Window — Python coding challenges
What you will find here
This page lists two pointers & sliding window challenges — real Python problems you solve in the browser IDE with instant test feedback. Each challenge includes a clear brief, starter code, and automated checks.
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.