class Solution {
public:
vector<vector<int> > ans;
vector<int> V;
void dfs(vector<int>& nums, int ind) {
if(ind >= nums.size()) {
ans.push_back(V);
return ;
}
dfs(nums, ind+1);
V.push_back(nums[ind]);
dfs(nums, ind+1);
V.pop_back();
}
vector<vector<int>> subsets(vector<int>& nums) {
dfs(nums, 0);
return ans;
}
};
08-18
193
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
04-19
208
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
05-05
437
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
04-05
339
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)