.
int* maxSlidingWindow(int* nums, int numsSize, int k, int* returnSize){
if (nums == NULL || numsSize == 0){
*returnSize = 0;//传参检查
return NULL;
}
*returnSize = numsSize - k + 1;
if (k <= 1)
return nums;
int* arr = (int*)malloc(sizeof(int)**returnSize);
for (int i=0; i<*returnSize; i++ )
{
int max = nums[i];
for (int j=i+1; j<i+k; j++)
{
if (nums[j] > max)
max = nums[j];
}
arr[i] = max;
}
return arr;
}