comefrom: <awangdev>361. Bomb Enemy_2.java
code: public int maxKilledEnemies(char[][] grid) {
          if (grid == null || grid.length == 0 || grid[0].length == 0) return 0;
          int m = grid.length, n = grid[0].length;
          int[] colSum = new int[n];
          int max = 0;
          int row = 0;
          for (int i = 0; i < m; i++) {
              for (int j = 0; j < n; j++) {                
                  if (j == 0 || grid[i][j - 1] == 'W') {
                      row = 0;
                      for (int k = j; k < n && grid[i][k] != 'W'; k++) {
                          row += grid[i][k] == 'E' ? 1 : 0;
                      }
                  }
                  
                  if (i == 0 || grid[i - 1][j] == 'W') {
                      colSum[j] = 0;
                      for (int k = i; k < m && grid[k][j] != 'W'; k++) {
                          colSum[j] += grid[k][j] == 'E' ? 1 : 0;
                      }
                  }
                  if (grid[i][j] == '0') max = Math.max(max, colSum[j] + row);
              }
          }
          return max;
      }
masked: public int sample_funcname ( char [ ] [ ] var_0 ) {
    if ( var_0 == null || var_0 . length == 0 || var_0 [ 0 ] . length == 0 ) return 0 ;
    int var_1 = var_0 . length , var_2 = var_0 [ 0 ] . length ;
    int [ ] var_3 = new int [ var_2 ] ;
    int max = 0 ;
    int var_4 = 0 ;
    for ( int var_5 = 0 ;
    var_5 < var_1 ;
    var_5 ++ ) {
      for ( int var_6 = 0 ;
      var_6 < var_2 ;
      var_6 ++ ) {
        if ( var_6 == 0 || var_0 [ var_5 ] [ var_6 - 1 ] == 'W' ) {
          var_4 = 0 ;
          for ( int var_7 = var_6 ;
          var_7 < var_2 && var_0 [ var_5 ] [ var_7 ] != 'W' ;
          var_7 ++ ) {
            var_4 += var_0 [ var_5 ] [ var_7 ] == 'E' ? 1 : 0 ;
          }
        }
        if ( var_5 == 0 || var_0 [ var_5 - 1 ] [ var_6 ] == 'W' ) {
          var_3 [ var_6 ] = 0 ;
          for ( int var_7 = var_5 ;
          var_7 < var_1 && var_0 [ var_7 ] [ var_6 ] != 'W' ;
          var_7 ++ ) {
            var_3 [ var_6 ] += var_0 [ var_7 ] [ var_6 ] == 'E' ? 1 : 0 ;
          }
        }
        if ( var_0 [ var_5 ] [ var_6 ] == '0' ) max = Math . max ( max , var_3 [ var_6 ] + var_4 ) ;
      }
    }
    return max ;
  }
  