739.毎日温度Daily Temperatures
タイトルhttps://leetcode-cn.com/problems/daily-temperatures/
int* dailyTemperatures(int* T, int TSize, int* returnSize){
*returnSize = TSize;
int *n = malloc(sizeof(int) * TSize);
n[TSize-1] = 0;
int i,j;
for(i = TSize-2;i>=0;i--){
if(T[i]>=T[i+1]){// i i+1
// , , j>=TSize, T[j]>T[i], n[j]==0
for(j=i+1;j= TSize){//
n[i] = 0;
}else if(T[j] > T[i]){//
n[i] = j-i;
}else{//
n[i] = 0;
}
}
else{// i i+1
n[i] = 1;
}
}
return n;
}