An n x n grid is composed of 1 x 1 squares where each 1 x 1 square consists of a '/', '\', or blank space ' '. These characters divide the square into contiguous regions. Given the grid grid represented as a string array, return the number of regions.
Java
Regions Cut By Slashes
An n x n grid is composed of 1 x 1 squares where each 1 x 1 square consists of a '/', '', or blank space ' '. These characters divide the square into contiguous regions. Given the grid grid represented as a string array, return the number of regions.
Example 1:
Input: [" /","/ "]
Output: 2
Input
arr =[" /","/ "]
Expanding 2x2 grid to 6x6 for slash representation