Advertisement
bbescos

Untitled

Jan 28th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | None | 0 0
  1.     // Run-time complexity O(n)
  2.     // Memory complexity O(1)
  3.     void reverseString(vector<char>& s) {
  4.         for (int i = 0; i < s.size()/2; ++i) {
  5.             swap(s[i], s[s.size() - 1 - i]);
  6.         }
  7.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement