public void visit(int num, int end){
        if(end == k){
            ArrayList<Integer> oneAns = new ArrayList<Integer>();
            for(int i = 0; i < end; i++) oneAns.add(ans[i]);
            res.add(oneAns);
            return;
        }
        if(num == n || n - num < k - end) return;
        visit(num+1, end);
        ans[end] = num+1;
        visit(num+1, end+1);
    }