private void subsets_sub(List<List<Integer>> ret, List<Integer> tmp, int[] num, int start)
    {
    	for (int i = start; i < num.length; ++i)
    	{
    		tmp.add(num[i]);
    		ret.add(new ArrayList<Integer>(tmp));
    		subsets_sub(ret, tmp, num, i+1);
    		tmp.remove(tmp.size()-1);
    		while (i < num.length-1 && num[i] == num[i+1])//skip duplicates
    		{
    			++i;
    		}
    	}
    }