You are viewing a single comment's thread. Return to all comments →
Here is my c++ solution, you can watch video explanation here : https://youtu.be/Z_CYzW_sQAE
Solution 1
vector<int> reverseArray(vector<int> a) { reverse(a.begin(), a.end()); return a; }
Solution 2
vector<int> reverseArray(vector<int> a) { vector<int> result; for(int i = a.size() - 1; i >= 0; i--){ result.push_back(a[i]); } return result; }
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 →
Here is my c++ solution, you can watch video explanation here : https://youtu.be/Z_CYzW_sQAE
Solution 1
Solution 2