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;
- }
- };
来源: http://www.bubuko.com/infodetail-3377298.html