You are viewing a single comment's thread. Return to all comments →
vector<int> reverseArray(vector<int> a) { int start = 0; int end = a.size() - 1; while(start < end) { swap(a[start], a[end]); start++; end--; } return a; }
Seems like cookies are disabled on this browser, please enable them to open this website
Arrays - DS
You are viewing a single comment's thread. Return to all comments →
Simple solution