```
class Solution {
public:
vector<vector<int> > ans;
vector<int> cur;
int n_, k_;
vector<vector<int> > combine(int n, int k) {
cur.clear(), ans.clear();
n_=n, k_=k;
dfs(1,0);
return ans;
}
void dfs(int ni, int ki)
{
if(ki==k_)
{
ans.push_back(cur);
return ;
}
if(ni>n_) return ;
dfs(ni+1, ki);
cur.push_back(ni);
dfs(ni+1, ki+1);
cur.pop_back();
}
};
```

seems C(n,k), but not sure, upper bound is 2^n exactly.

But the proning is not clear.

Could anybody help me? Thanks.