对于数组,字符串,链表-------------------->双指针的方法很重要
class Solution {
public:
void reverseString(vector<char>& s) {
int right = s.size() - 1, left = 0;
char a;
while (right > left){
a = s[left];
s[left] = s[right];
s[right] = a;
--right;
++left;
}
}
};