class Solution {

public:

void recur(vector<vector<int> >&res, vector<int> &sub, int subNum, vector<int>&S)

{

```
for(int j=subNum;j<S.size();j++)
{
sub.push_back(S[j]);
res.push_back(sub);
if (j<S.size()-1)
recur(res, sub, subNum+1, S);
sub.pop_back();
}
}
vector<vector<int> > subsets(vector<int> &S) {
vector<vector<int> > res;
vector<int> sub;
if(S.size()==0) return res;
res.push_back(sub);
sort(S.begin(),S.end());
recur(res, sub, 0,S);
return res;
}
```

};

Anybody can find mistakes for me?