Gorgias (CA) interview question

Similar to the maximum sliding window problem on Leetcode