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; }