comefrom: <awangdev>229. Majority Element II_1.java
code: public List<Integer> majorityElement(int[] nums) {
          List<Integer> result = new ArrayList<>();
          if (nums == null || nums.length == 0) {
              return result;
          }
          int valA = 0, valB = 0, countA = 0, countB = 0;
          for (int num : nums) {
              if (num == valA) {
                  countA++;
              } else if (num == valB) {
                  countB++;
              } else if (countA == 0) {
                  valA = num;
                  countA++;
              } else if (countB == 0){
                  valB = num;
                  countB++;
              } else {
                  countA--;
                  countB--;
              }
          }
          
          countA = 0; 
          countB = 0;
          for (int num : nums) {
              if (num == valA) {
                  countA++;
              } else if (num == valB) {
                  countB++;
              }
          }
          if (countA > nums.length / 3) result.add(valA);
          if (countB > nums.length / 3) result.add(valB);
          return result;
      }
masked: public List < Integer > var_0 ( int [ ] var_1 ) {
    List < Integer > var_2 = new ArrayList < > ( ) ;
    if ( var_1 == null || var_1 . length == 0 ) {
      return var_2 ;
    }
    int var_3 = 0 , var_4 = 0 , var_5 = 0 , var_6 = 0 ;
    for ( int var_7 : var_1 ) {
      if ( var_7 == var_3 ) {
        var_5 ++ ;
      }
      else if ( var_7 == var_4 ) {
        var_6 ++ ;
      }
      else if ( var_5 == 0 ) {
        var_3 = var_7 ;
        var_5 ++ ;
      }
      else if ( var_6 == 0 ) {
        var_4 = var_7 ;
        var_6 ++ ;
      }
      else {
        var_5 -- ;
        var_6 -- ;
      }
    }
    var_5 = 0 ;
    var_6 = 0 ;
    for ( int var_7 : var_1 ) {
      if ( var_7 == var_3 ) {
        var_5 ++ ;
      }
      else if ( var_7 == var_4 ) {
        var_6 ++ ;
      }
    }
    if ( var_5 > var_1 . length / 3 ) var_2 . add ( var_3 ) ;
    if ( var_6 > var_1 . length / 3 ) var_2 . add ( var_4 ) ;
    return var_2 ;
  }
  