偷懒写法(next_permutation nb!)
class Solution {
public:
vector<vector<int>> ans;
vector<vector<int>> permutation(vector<int>& nums) {
do
{
ans.push_back(nums);
}while(next_permutation(nums.begin(), nums.end())); // 全排列
return ans;
}
};