class Solution {
public:
vector<vector<int>> res;
void helper(int begin, int n, int k, vector<int> curres){
if (curres.size() == k) res.push_back(curres);
else{
for (int i=begin; i<=n-(k-curres.size())+1; i++){
curres.push_back(i);
helper(i+1, n, k, curres);
curres.pop_back();
}
}
return;
}
vector<vector<int>> combine(int n, int k) {
helper(1,n, k, vector<int>());
return res;
}
};