public static ArrayList<Integer> slidingMaximumDqueue(final List<Integer> a, int b) {

        ArrayList<Integer> result = new ArrayList<Integer>();
        Deque<Integer> deque = new ArrayDeque<>();

        for (int i = 0; i < b; i++) {
            while (!deque.isEmpty() && a.get(deque.getLast()) <= a.get(i)) {
                deque.removeLast();
            }
            deque.addLast(i);
        }
        if (a.size() <= b) {
            result.add(a.get(deque.getFirst()));
            return result;
        }
        System.out.println("queue : " + deque);
        System.out.println("result : " + result);
        for (int i = b; i < a.size(); i++) {

            System.out.println("queue : " + deque);
            System.out.println("result : " + result);

            result.add(a.get(deque.getFirst()));
            while (!deque.isEmpty() && deque.getFirst() <= i - b) {
                deque.removeFirst();
            }
            while (!deque.isEmpty() && a.get(i) >= a.get(deque.getLast())) {
                deque.removeLast();
            }
            deque.addLast(i);
        }
        result.add(a.get(deque.getFirst()));
        return result;
    }