Sliding Window
Max Value
For the window, we will be using a dequeue data structure, for it takes O(1) for both popping from the start and the end. The main idea is to keep the highest element at the window[0] position.
For this algorithm, we would have two loops:
- Initialise the dequeue structure