class Solution {
public:
vector<string> Permutation(string str) {
if(str.length() < 1) return *(new vector<string>);
char s[10];
memset(s,0,sizeof(s));
int l = str.length();
for(int i=0;i<l;i++){
s[i] = str[i];
}
sort(s,s+l);
string t;
vector<string> ans;
do{
for(int i=0;i<l;i++) t += s[i];
ans.push_back(t);
t = "";
}while(next_permutation(s,s+l));
return ans;
}
};