Search
⌘K

Leetcode 361. Bomb Enemy

Given a grid with walls, enemies, and empty cells, find the maximum number of enemies that can be killed by placing a bomb in a single empty cell which destroys all enemies along its row and column until blocked by walls. The key is to compute enemy counts for row/column segments between walls (via scanning and caching) to avoid re-counting for every empty cell.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.