剑指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;
    }
};
posted @ 2020-01-12 12:52  virgil_devil  阅读(67)  评论(0编辑  收藏  举报