https://oj.leetcode.com/problems/subsets-ii/

http://blog.csdn.net/linhuanmars/article/details/24613193

public class Solution {
    public List> subsetsWithDup(int[] num) {
        
        Arrays.sort(num);
        
        Set> results = new HashSet<>();
        help(num, 0, new ArrayList(), results);
        return new ArrayList>(results);
    }
    
    // Don't know how to handle duplicate cases :(
    // Using set
    private void help(int[] n, int start, List items, Set> results)
    {
        results.add(new ArrayList(items));
        
        for (int i = start ; i < n.length ; i ++)
        {
            items.add(n[i]);
            
            help(n, i + 1, items, results);
            
            items.remove(items.size() - 1);
        }
    }
}