【leetcode】圆形赛道上经过次数最多的扇区

int* mostVisited(int n, int* rounds, int roundsSize, int* returnSize){
    int i,pst=0;
    int* arr = (int*)calloc(n,sizeof(int));
    if (rounds[roundsSize-1] >= rounds[0]){
        for (i=rounds[0]; i<=rounds[roundsSize-1]; i++) 
            arr[pst++] = i;
    }
    else{
        for (i=1; i<=n; i++)
            if (i<= rounds[roundsSize-1] || i>=rounds[0]) arr[pst++] = i;
    }
    *returnSize = pst;
    return arr;
}
原文地址:https://www.cnblogs.com/ganxiang/p/13678605.html