Skip to content

Files

Latest commit

bf37b71 · Sep 12, 2024

History

History

03-sliding-window

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Sep 1, 2024
Sep 4, 2024
Sep 7, 2024
Sep 7, 2024
Sep 7, 2024
Sep 8, 2024
Sep 9, 2024
Sep 9, 2024
Sep 9, 2024
Sep 9, 2024
Sep 12, 2024
Sep 12, 2024

README.md

Pattern: Sliding Window

The sliding window technique involves maintaining a fixed or variable-sized window of contiguous subarrays that "slides" over a sequence (such as an array or string) to perform operations on the elements within the window.

This technique is often used for solving problems that require processing or analyzing all contiguous subarrays of a given size or that meet specific conditions, with the window size sometimes being dynamic—expanding or shrinking based on problem-specific constraints to optimize the solution.

Problems

Problem Complexity
Maximum Sum Subarray of Size K 🌟
Smallest Subarray with a Given Sum 🌟
Longest Substring with K Distinct Characters 🌟 🌟
Fruits into Baskets 🌟 🌟
No-repeat Substring 🌟 🌟 🌟
Longest Substring with Same Letters after Replacement 🌟 🌟 🌟
Longest Subarray with Ones after Replacement 🌟 🌟 🌟
Permutation in a String 🌟 🌟 🌟
String Anagrams 🌟 🌟 🌟
Smallest Window Containing Substring 🌟 🌟 🌟
Words Concatenation 🌟 🌟 🌟