An grid is composed of , squares, where each square consists of a “/”, “\”, or a blank space. These characters divide the square into adjacent regions.
Given the grid represented as a string array, return the number of adjacent regions.
Note:
- Backslash characters are escaped, so “\” is represented as “\\”.
- A square in the grid will be referred to as a box.
Constraints:
grid.length 30The following illustration shows how the grid can be visualized:
An grid is composed of , squares, where each square consists of a “/”, “\”, or a blank space. These characters divide the square into adjacent regions.
Given the grid represented as a string array, return the number of adjacent regions.
Note:
- Backslash characters are escaped, so “\” is represented as “\\”.
- A square in the grid will be referred to as a box.
Constraints:
grid.length 30The following illustration shows how the grid can be visualized: