344. 反转字符串

344. 反转字符串


题目链接:344. 反转字符串

思路:表示确实偷懒了,直接用自带方法解决的。

代码如下:

class Solution {
public:
    void reverseString(vector<char>& s) {
        reverse(s.begin(),s.end());
    }
};

你可能感兴趣的:(leetcode,c++)