class Solution {
public:
vector<vector<int> >ans;
vector<int>tmp;
void dfs(int dep,int maxDep,int start,int end)
{
if(dep==maxDep)
{
ans.push_back(tmp);
return;
}
for(int i=start;i<=end;i++)
{
tmp[dep]=i;
dfs(dep+1,maxDep,i+1,end);//
}
}
vector<vector<int> > combine(int n, int k) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
tmp.resize(k);
ans.clear();
dfs(0,k,1,n);
return ans;
}
};