题目:
题解:
class Solution {
public:void reverseString(vector<char>& s) {int n = s.size();for (int left = 0, right = n - 1; left < right; ++left, --right) {swap(s[left], s[right]);}}
};
题目:
题解:
class Solution {
public:void reverseString(vector<char>& s) {int n = s.size();for (int left = 0, right = n - 1; left < right; ++left, --right) {swap(s[left], s[right]);}}
};