Given an grid of characters, each cell is defined as follows:
'W' represents a wall.
'E' represents an enemy.
'0' represents an empty cell.
Return the maximum number of enemies you can destroy by placing one bomb in an empty cell.
When a bomb is placed in an empty cell, it destroys all enemies in the same row and column extending in all four directions up to the edge of the grid or until blocked by a wall, because walls cannot be destroyed.
Constraints:
m grid.length
n grid[i].length
grid[i][j] is either 'W', 'E', or '0'.
Given an grid of characters, each cell is defined as follows:
'W' represents a wall.
'E' represents an enemy.
'0' represents an empty cell.
Return the maximum number of enemies you can destroy by placing one bomb in an empty cell.
When a bomb is placed in an empty cell, it destroys all enemies in the same row and column extending in all four directions up to the edge of the grid or until blocked by a wall, because walls cannot be destroyed.
Constraints:
m grid.length
n grid[i].length
grid[i][j] is either 'W', 'E', or '0'.