public void findAllSubset(int[] num, ArrayList<ArrayList<Integer>> res, int[] temp, 
			int cur, int pos) {
		if(cur == num.length) {
			ArrayList<Integer> list = new ArrayList<Integer>();
			for(int i = 0; i < pos; i++) list.add(temp[i]);
			res.add(list);
			return;
		}
		int count = 1, base = num[cur];
		for(cur = cur + 1; cur < num.length && num[cur] == base; cur++) count++;
		findAllSubset(num, res, temp, cur, pos); // bug: forgot the empty one
		for(int i = 0; i < count; i++) {
			temp[pos+i] = base;
			findAllSubset(num, res, temp, cur, pos+i+1);
		}
	}