剑指OFFER 字符串的排列

剑指OFFER 字符串的排列

STL标准库解法

class Solution {
public:
    vector<string> Permutation(string str) {
        vector<string> res;
        if(str=="")return res;
        do{
            res.push_back(str);
        }while(next_permutation(str.begin(),str.end()));
        return res;
    }
};
原文地址:https://www.cnblogs.com/virgildevil/p/12182432.html