class Solution {
public:
vector[HTML_REMOVED]> permutation(vector[HTML_REMOVED]& nums) {
vector[HTML_REMOVED]> res;
// if(nums.empty()) return res;
vector[HTML_REMOVED] oneres;
permutation(res, nums, oneres);
return res;
}
void permutation(vector<vector<int>> &res, vector<int> nums, vector<int> &oneres){
if(nums.empty()){
res.push_back(oneres);
return;
// oneres.pop_back();
}
for(vector<int>::iterator it = nums.begin(); it != nums.end(); it++){
auto a = *it;
oneres.push_back(*it);
nums.erase(it);
permutation(res, nums, oneres);
nums.insert(it, a);
oneres.pop_back();
}
}
};