class Solution {
public:
vector<vector<int>> subsets(vector<int>& nums) {
vector<vector<int>> subsets;
vector<int> record;
for (int i = 0; i < nums.size(); i++) {
getSubSet(subsets, record, nums, 0, i + 1);
}
subsets.push_back(vector<int>());
return subsets;
}
private:
void getSubSet(vector<vector<int>>& subsets, vector<int>& record, vector<int>& nums, int start, int numMember){
if (numMember == record.size()) {
subsets.push_back(record);
return;
}
for (int i = start; i < nums.size(); i++) {
record.push_back(nums[i]);
getSubSet(subsets, record, nums, i + 1, numMember);
record.pop_back();
}
}
};