Milena is in a rectangular room with a floor divided into equal square cells. A cell is considered good if it
contains a light bulb and bad if it does not. The j-th character of the i-th element of
the String[] floor is uppercase 'Y' if the cell at row i, column j is good and 'N' if it is bad.
At time 0, Milena is at cell (row, col) and all the light bulbs are turned off.
Cell (row, col) will always be a bad cell. All row and column indices are 0-based.
Milena will choose one direction (up, down, left or right) and move at most K cells in that direction.
She is not allowed to leave the room. When she steps on a good cell, the light bulb in that cell will turn on,
and the light bulbs in all its neighboring good cells will also turn on. Two cells neighbor each other
only if they share a side. Return the maximal number of light bulbs Milena can turn on.
|