leetcode 面试题 08.07. 无重复字符串的排列组合

在这里插入图片描述

class Solution {
public:
    vector<string> permutation(string S) {
        vector<string> res;
        sort(S.begin(), S.end());
        do
        {
            res.push_back(S);
        }while(next_permutation(S.begin(), S.end()));
        return res;
    }
};

猜你喜欢

转载自blog.csdn.net/weixin_43956456/article/details/107721910