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.
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

Original Grid
·
/
/
·
Expanded Grid (3x)
Black = slash, Colors = regions
Result
Regions

0

Legend
Slash (wall)
Region 1
Region 2
Variables
No variables to display
DepthFunction Call
Stack empty
0/2