Solve the sliding window maximum problem using a double ended deque holding the maximum values, an O(n) solution.