Leetcode 344. 反转字符串

344. Reverse String

解题代码:

1 class Solution {
2 public:
3     void reverseString(vector<char>& s) 
4     {
5         int i = 0, j = s.size() -1;
6         while(i < j)
7             swap(s[i++], s[j--]);    
8     }
9 };
原文地址:https://www.cnblogs.com/sunbines/p/10621463.html