comefrom: <garvit244>361_1.py
code: def maxKilledEnemies( grid):
      if not grid or len(grid) == 0 or len(grid[0]) == 0:
          return 0
      
      result, row_count = float('-inf'), 0
      column_count = [0]*len(grid[0])
      for row in range(len(grid)):
          for column in range(len(grid[0])):
              if column == 0 or grid[row][column-1] == 'W':
                  row_count = 0
                  for index in range(column, len(grid[0])):
                      if grid[row][index] == 'W':
                          break
                      row_count += 1 if grid[row][index] == 'E' else 0
      
              if row == 0 or grid[row-1][column] == 'W':
                  column_count[column] = 0
                  for index in range(row, len(grid)):
                      if grid[index][column] == 'W':
                          break
                      column_count[column] += 1 if grid[index][column] == 'E' else 0
      
              if grid[row][column] == '0':
                  result = max(result, row_count + column_count[column])
      return result
masked: def sample_funcname ( var_0 ) :
      if not var_0 or len ( var_0 ) == 0 or len ( var_0 [ 0 ] ) == 0 :
          return 0
      var_5 , var_6 = float ( '-inf' ) , 0
      var_7 = [ 0 ] * len ( var_0 [ 0 ] )
      for var_9 in range ( len ( var_0 ) ) :
          for var_10 in range ( len ( var_0 [ 0 ] ) ) :
              if var_10 == 0 or var_0 [ var_9 ] [ var_10 - 1 ] == 'W' :
                  var_6 = 0
                  for var_13 in range ( var_10 , len ( var_0 [ 0 ] ) ) :
                      if var_0 [ var_9 ] [ var_13 ] == 'W' :
                          break
                      var_6 += 1 if var_0 [ var_9 ] [ var_13 ] == 'E' else 0
              if var_9 == 0 or var_0 [ var_9 - 1 ] [ var_10 ] == 'W' :
                  var_7 [ var_10 ] = 0
                  for var_13 in range ( var_9 , len ( var_0 ) ) :
                      if var_0 [ var_13 ] [ var_10 ] == 'W' :
                          break
                      var_7 [ var_10 ] += 1 if var_0 [ var_13 ] [ var_10 ] == 'E' else 0
              if var_0 [ var_9 ] [ var_10 ] == '0' :
                  var_5 = max ( var_5 , var_6 + var_7 [ var_10 ] )
      return var_5
  