The queue will store indexes of useful elements in every window In deque ' G ' we maintain decreasing order of values from front to rear In deque ' S ' we maintain increasing order of values from front to rear
Deque < Integer > S = new LinkedList < > ( ) , G = new LinkedList < > ( ) ;