https://leetcode.com/problems/sliding-window-maximum I think this is well-known problem, could write a brture force approach, for the optimal one, interviewer suggested to use a Deque, picked up on that and wrote some bare minimum code, just wanted to share questions.