public int[] maxSlidingWindow(int[] nums, int k) {
		if (nums == null || nums.length == 0 || nums.length < k) {
			return new int[0];
		}
		
		int[] result = new int[nums.length - k + 1];
		
		ArrayDeque<Integer> deque = new ArrayDeque<Integer>();
		
		for (int i = 0; i < nums.length; i++) {
			while (!deque.isEmpty() && deque.getLast() < nums[i]) {
				deque.removeLast();
			}
			
			deque.offer(nums[i]);
			
			if (i < k - 1) {
				continue;
			}
			
			result[i - k + 1] = deque.getFirst();
			
			if (result[i - k + 1] == nums[i - k + 1]) {
				deque.removeFirst();
			}
		}
		
		return result;
	}