We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
vector<int> reverseArray(vector<int> a) {
int aux = 0;
int n = a.size();
for (int i = 0; i < n/2; ++i) {
aux = a[n-i-1];
a[n-i-1] = a[i];
a[i] = aux;
}
return a;
}
Arrays - DS
You are viewing a single comment's thread. Return to all comments →
My c++ solution: