链接:https://leetcode-cn.com/problems/zuo-xuan-zhuan-zi-fu-chuan-lcof/
代码
class Solution {
public:
string reverseLeftWords(string s, int n) {
reverse(s.begin(), s.end());
reverse(s.begin(), s.begin() + s.size() - n);
reverse(s.begin() + s.size() - n, s.end());
return s;
}
};