<awangdev>78. Subsets_3.java
public List<List<Integer>> subsets(int[] nums) {
        List<List<Integer>> result = new ArrayList<>();
        if (nums == null || nums.length == 0) {
            return result;
        }
        int n = nums.length;
        long maxRange = (long) Math.pow(2, n) - 1;

        for (int i = 0; i <= maxRange; i++) {
            List<Integer> list = new ArrayList<>();
            int index = 0;
            int num = i;
            while (num != 0) {
                if ((num & 1) == 1) {
                    list.add(nums[index]);
                }
                num = num >> 1;
                index++;
            }
            result.add(list);
        }
        return result;
    }
public List < List < Integer >> var_2 ( int [ ] var_3 ) {
  List < List < Integer >> var_5 = new ArrayList < > ( ) ;
  if ( var_3 == null || var_3 . length == 0 ) {
    return var_5 ;
  }
  int var_9 = var_3 . length ;
  long var_14 = ( long ) Math . pow ( 2 , var_9 ) - 1 ;
  for ( int var_15 = 0 ;
  var_15 <= var_14 ;
  var_15 ++ ) {
    List < Integer > var_16 = new ArrayList < > ( ) ;
    int var_17 = 0 ;
    int var_18 = var_15 ;
    while ( var_18 != 0 ) {
      if ( ( var_18 & 1 ) == 1 ) {
        var_16 . add ( var_3 [ var_17 ] ) ;
      }
      var_18 = var_18 >> 1 ;
      var_17 ++ ;
    }
    var_5 . add ( var_16 ) ;
  }
  return var_5 ;
}
