/
* Return an array of size returnSize.
* Note: The returned array must be malloced, assume caller calls free().
/
int* maxInWindows(int* nums, int numsSize, int k, int* returnSize) {
int i=0,j=0;
*returnSize = numsSize - k +1;
int *numsReturn;
numsReturn = (int *)malloc(*returnSize);
memset(numsReturn,0x00,*returnSize*4);
for(i=0;i<*returnSize;i++)
{
for(j=0;j<k;j++)
{
if(numsReturn[i]<nums[i+j])
{
numsReturn[i] = nums[i+j];
}
}
}
return numsReturn;
}