public ArrayList<ArrayList<Integer>> combine(int n, int k) {
        ArrayList<ArrayList<Integer>> result = new ArrayList<ArrayList<Integer>>();
        //if n < k, will not fit the problem
        if (n < k) {
            return result;
        }

        result.add(new ArrayList<Integer>());
        //set numbers into list, size k
        for (int i = 0; i < k; i++) {
            ArrayList<ArrayList<Integer>> current = new ArrayList<ArrayList<Integer>>();
            //get the list from result, add up the next number
            for (ArrayList temp : result) {
                int x = 0;
                //if there already has number, get the largest one
                if (temp.size() > 0) {
                    x = (int) temp.get(temp.size() - 1);
                }
                //add the next number to the list, and put the list into result
                for (int j = x + 1; j <= n - k + i + 1; j++) {
                    ArrayList<Integer> b = new ArrayList<Integer>(temp);
                    b.add(j);
                    current.add(b);
                }
            }
            //copy the list, both of the method are right
            result = (ArrayList<ArrayList<Integer>>) current.clone();
            //result = new ArrayList<ArrayList<Integer>>(current);
        }
        return result;
    }