comefrom: <awangdev>849. Maximize Distance to Closest Person_1.java
code: public int maxDistToClosest(int[] seats) {
          if (seats == null || seats.length == 0) return -1;
          
          int n = seats.length, dist = 0;
          int start = seats[0] == 1 ? 0 : -1; 
          
          for (int end = 1; end < n; end++) {
              if (seats[end] == 1) {
                  if (start == -1) dist = end;
                  else dist = Math.max(dist, (end - start) / 2);
                  start = end; 
              } 
          }
          
          if (seats[n - 1] == 0) dist = Math.max(dist, n - 1 - start);
          
          return dist;
      }
masked: public int sample_funcname ( int [ ] var_0 ) {
    if ( var_0 == null || var_0 . length == 0 ) return - 1 ;
    int var_1 = var_0 . length , var_2 = 0 ;
    int var_3 = var_0 [ 0 ] == 1 ? 0 : - 1 ;
    for ( int var_4 = 1 ;
    var_4 < var_1 ;
    var_4 ++ ) {
      if ( var_0 [ var_4 ] == 1 ) {
        if ( var_3 == - 1 ) var_2 = var_4 ;
        else var_2 = Math . max ( var_2 , ( var_4 - var_3 ) / 2 ) ;
        var_3 = var_4 ;
      }
    }
    if ( var_0 [ var_1 - 1 ] == 0 ) var_2 = Math . max ( var_2 , var_1 - 1 - var_3 ) ;
    return var_2 ;
  }
  