comefrom: <awangdev>717. 1-bit and 2-bit Characters_2.java
code: public boolean isOneBitCharacter(int[] bits) {
          if (bits == null || bits.length == 0) {
              return false;
          }
          int n = bits.length;
          if (n == 1) {
              return bits[0] == 0;
          }
          if (bits[n - 1] != 0) {
              return false;
          }
          
          boolean[] dp = new boolean[n];
          dp[0] = bits[0] == 0;
          dp[1] = bits[0] != 0 || bits[1] != 1;
          for (int i = 2; i < n - 1; i++) {
              if (bits[i] == 0) {
                  dp[i] = dp[i - 2] || dp[i - 1];
              } else if (bits[i] == 1) {
                  dp[i] = dp[i - 2] && bits[i - 1] == 1;
              }
          }
          return dp[n - 2];
      }
masked: public boolean var_0 ( int [ ] var_1 ) {
    if ( var_1 == null || var_1 . length == 0 ) {
      return false ;
    }
    int var_2 = var_1 . length ;
    if ( var_2 == 1 ) {
      return var_1 [ 0 ] == 0 ;
    }
    if ( var_1 [ var_2 - 1 ] != 0 ) {
      return false ;
    }
    boolean [ ] var_3 = new boolean [ var_2 ] ;
    var_3 [ 0 ] = var_1 [ 0 ] == 0 ;
    var_3 [ 1 ] = var_1 [ 0 ] != 0 || var_1 [ 1 ] != 1 ;
    for ( int var_4 = 2 ;
    var_4 < var_2 - 1 ;
    var_4 ++ ) {
      if ( var_1 [ var_4 ] == 0 ) {
        var_3 [ var_4 ] = var_3 [ var_4 - 2 ] || var_3 [ var_4 - 1 ] ;
      }
      else if ( var_1 [ var_4 ] == 1 ) {
        var_3 [ var_4 ] = var_3 [ var_4 - 2 ] && var_1 [ var_4 - 1 ] == 1 ;
      }
    }
    return var_3 [ var_2 - 2 ] ;
  }
  