var combine = function(n, k) {
let res=[];
backtracking(1,[]);
return res;
function backtracking(start,temp){
if(temp.length==k) res.push([...temp]);
for(var i=start;i<=n;i++){
temp.push(i);
backtracking(i+1,temp);
temp.pop();
}
}
};