public int[] maxSlidingWindow_MaxQueue(int[] nums, int k) {
        if (nums == null || k <= 0)
            return new int[0];
        int n = nums.length;
        int[] ans = new int[n - k + 1];
        MaxQueue q = new MaxQueue();
        int index = 0;

        for (int i = 0; i < k; ++i) {
            q.push(nums[i]);
        }
        ans[index++] = q.getMax();
        for (int i = k; i < n; ++i) {
            q.pop();
            q.push(nums[i]);
            ans[index++] = q.getMax();
        }
        return ans;
    }