links: [[Algorithms MOC#Techniques]]
---
# Sliding Window
This technique is used to find contiguous sub-string or sub-array from a string or array, based on some conditions
## How to use?
1. It normally start with two pointers or indices called *left* and *right* which will start from 0.
2. increment the *right* as long as the necessary condition is satisfied
3. If a condition is not satisfied, you start increasing *left*. you might also do clean up tasks when left is moved
---
tags: #algorithm