public static ArrayList<ArrayList<Integer>> combine(int n, int k) {
		// Start typing your Java solution below
		// DO NOT write main() function
		if(n<k||k<=0) return null;
		ArrayList<ArrayList<Integer>> all = new  ArrayList<ArrayList<Integer>>();       
		if(k==1){
			for(int i=1;i<=n;i++){
				ArrayList<Integer> al = new ArrayList<Integer>();
				al.add(i);
				all.add(al);
			}
			return all;
		}
		for(int i=n;i>=k;i--){                
			for(ArrayList<Integer> al : combine(i-1,k-1)){
				al.add(i);  // mind that we add i here, not n!!
				// for each i, it can either be selected(as added in here), or unselected(ignored in the next iteration)
				all.add(al);
			} 
		}
		return all;       
	}