You are viewing a single comment's thread. Return to all comments →
I don't know why the all test cases are not being passed. My code solution is absolutely write as mentioned in the question.
int size; cin >> size; int *a = new int (size); for (int i = 0; i < size; i++) { cin >> a[i]; } int front = 0; int rear = size - 1; bool equal = true; int temp = 0; while (front < rear) { temp = a[rear]; a[rear] = a[front]; a[front] = temp; front++; rear--; } for (int i = 0; i < size; i++) { cout << a[i] << " "; }
Seems like cookies are disabled on this browser, please enable them to open this website
Arrays Introduction
You are viewing a single comment's thread. Return to all comments →
I don't know why the all test cases are not being passed. My code solution is absolutely write as mentioned in the question.