LeetCode 344 Reverse String
#include <string>
using namespace std;
class Solution {
public:
string reverseString(string s) {
int i = 0;
int j = s.size() - 1;
while (i < j)
{
swap(s[i], s[j]);
i++;
j--;
}
//reverse(s.begin(), s.end());直接reverse就好了
return s;
}
};