comefrom: <awangdev>Subsets II_2.java
code: public List<List<Integer>> subsetsWithDup(int[] nums) {
          List<List<Integer>> result = new ArrayList<>();
          if (nums == null || nums.length == 0) {
              return result;
          }
          Arrays.sort(nums);
          Queue<List<Integer>> queue = new LinkedList<>();
          List<Integer> initialList = new ArrayList<>();
          queue.offer(initialList);
  
          while (!queue.isEmpty()) {
              int size = queue.size();
  
              while (size > 0) {
                  List<Integer> indexRow = queue.poll();
                  List<Integer> list = new ArrayList<>();
                  for (int index : indexRow) {
                      list.add(nums[index]);
                  }
                  result.add(list);
  
                  int endIndex = indexRow.size() == 0 ?
                      0 : indexRow.get(indexRow.size() - 1) + 1;
                  for (int i = endIndex; i < nums.length; i++) {
  					if (i > endIndex && nums[i] == nums[i - 1]) { 
  						continue;
  					}
                      indexRow.add(i);
                      queue.offer(new ArrayList<>(indexRow));
                      indexRow.remove(indexRow.size() - 1);
                  }
                  size--;
              }
          }
          return result;
      }
masked: public List < List < Integer >> var_0 ( int [ ] var_1 ) {
    List < List < Integer >> var_2 = new ArrayList < > ( ) ;
    if ( var_1 == null || var_1 . length == 0 ) {
      return var_2 ;
    }
    Arrays . sort ( var_1 ) ;
    Queue < List < Integer >> var_3 = new LinkedList < > ( ) ;
    List < Integer > var_4 = new ArrayList < > ( ) ;
    var_3 . offer ( var_4 ) ;
    while ( ! var_3 . isEmpty ( ) ) {
      int size = var_3 . size ( ) ;
      while ( size > 0 ) {
        List < Integer > var_5 = var_3 . poll ( ) ;
        List < Integer > var_6 = new ArrayList < > ( ) ;
        for ( int var_7 : var_5 ) {
          var_6 . add ( var_1 [ var_7 ] ) ;
        }
        var_2 . add ( var_6 ) ;
        int var_8 = var_5 . size ( ) == 0 ? 0 : var_5 . get ( var_5 . size ( ) - 1 ) + 1 ;
        for ( int var_9 = var_8 ;
        var_9 < var_1 . length ;
        var_9 ++ ) {
          if ( var_9 > var_8 && var_1 [ var_9 ] == var_1 [ var_9 - 1 ] ) {
            continue ;
          }
          var_5 . add ( var_9 ) ;
          var_3 . offer ( new ArrayList < > ( var_5 ) ) ;
          var_5 . remove ( var_5 . size ( ) - 1 ) ;
        }
        size -- ;
      }
    }
    return var_2 ;
  }
  