comefrom: <awangdev>Subsets II_4.java
code: public ArrayList<ArrayList<Integer>> subsetsWithDup(ArrayList<Integer> S) {
      	ArrayList<ArrayList<Integer>> rst = new ArrayList<ArrayList<Integer>>();
      	if (S == null || S.size() == 0) {
      		return rst;
      	}
      	Collections.sort(S);
      	Queue<ArrayList<Integer>> queue = new LinkedList<ArrayList<Integer>>();
      	ArrayList<Integer> list = new ArrayList<Integer>();
      	queue.offer(new ArrayList<Integer>(list));
      	rst.add(new ArrayList<Integer>(list));
      	
      	for (int i = 0; i < S.size(); i++) {
      		int num = S.get(i);
      		int size = queue.size();
      		while(size > 0) {
  	    		list = queue.poll();
  	    		list.add(num);
  	    		if (!rst.contains(list)) {
  	    			rst.add(new ArrayList<Integer>(list));
  	    		}
  	    		queue.offer(new ArrayList<Integer>(list));
  	    		list.remove(list.size() - 1);
  	    		queue.offer(new ArrayList<Integer>(list));
  	    		size--;
  	    	}
      	}
      	return rst;
      }
masked: public ArrayList < ArrayList < Integer >> var_0 ( ArrayList < Integer > var_1 ) {
    ArrayList < ArrayList < Integer >> var_2 = new ArrayList < ArrayList < Integer >> ( ) ;
    if ( var_1 == null || var_1 . size ( ) == 0 ) {
      return var_2 ;
    }
    Collections . sort ( var_1 ) ;
    Queue < ArrayList < Integer >> var_3 = new LinkedList < ArrayList < Integer >> ( ) ;
    ArrayList < Integer > var_4 = new ArrayList < Integer > ( ) ;
    var_3 . offer ( new ArrayList < Integer > ( var_4 ) ) ;
    var_2 . add ( new ArrayList < Integer > ( var_4 ) ) ;
    for ( int var_5 = 0 ;
    var_5 < var_1 . size ( ) ;
    var_5 ++ ) {
      int var_6 = var_1 . get ( var_5 ) ;
      int size = var_3 . size ( ) ;
      while ( size > 0 ) {
        var_4 = var_3 . poll ( ) ;
        var_4 . add ( var_6 ) ;
        if ( ! var_2 . contains ( var_4 ) ) {
          var_2 . add ( new ArrayList < Integer > ( var_4 ) ) ;
        }
        var_3 . offer ( new ArrayList < Integer > ( var_4 ) ) ;
        var_4 . remove ( var_4 . size ( ) - 1 ) ;
        var_3 . offer ( new ArrayList < Integer > ( var_4 ) ) ;
        size -- ;
      }
    }
    return var_2 ;
  }
  