Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Resolves #65
Algorithm:
Consider this grid for example, where brown tiles are the walls and the green ones are the enemies:

When we start the counting for each tile, we first start by counting the first column at the first row. Here, we count 2 for the row and 1 one the column. When we continue to count in the same row, we don't encounter any new walls, hence the count for this row should not change. We can keep the count of this row in a variable and change it only if we encounter a wall, otherwise we would be making unneeded checks.
The same things is valid for the columns. We have counted the column values up until their end or a wall as well. Since we are not directly iterating through the columns, we can keep the number of enemies that we have hit in an array for the columns.
At the first column, for example, we can always reuse the information we have experienced from the first row, as we do not encounter any new walls their.
In places like the 3rd row, our row counter will be reset when we come across a new wall.