leetcode题目
void backtrack(vector<vector<int>>& res, vector<int>& output, int first, int len){if (first==len){res.push_back(output);}for (int i = first; i < len; ++i) {std::swap(output[first],output[i]);backtrack(res,output,first+1,len);std::swap(output[i],output[first]);}
}vector<vector<int>> permute(vector<int>& nums) {vector<vector<int> > res;backtrack(res, nums, 0, (int)nums.size());return res;
}