简单地进行字符串的翻转
//Runtime: 56 ms, faster than 98.42%
//Memory Usage: 17.9 MB, less than 44.07%
class Solution {
public:
void reverseString(vector<char>& s) {
char temp;
for(int i = 0; i< s.size() / 2;++i){
temp = s[i];
s[i] = s[s.size() - 1 - i];
s[s.size() - 1 -i] = temp;
}
}
};