You are viewing a single comment's thread. Return to all comments →
*Test Case 8 is failing because of TIMEOUT. Any suggestions ? *
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int size; int arr[100001];
scanf("%d", &size); int shift, temp; scanf("%d", &shift); for (int i = 0; i < size; i++) { scanf("%d", &arr[i]); } for (int i = 0; i < shift; i++) { temp = arr[0]; for (int j = 0; j < size; j++) { arr[j] = arr[j + 1]; } arr[size - 1] = temp; } for (int x = 0; x < size; x++) { printf("%d ", arr[x]); } return 0;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Left Rotation
You are viewing a single comment's thread. Return to all comments →
*Test Case 8 is failing because of TIMEOUT. Any suggestions ? *
int main() {
int size; int arr[100001];
}