<p>An <code>n x n</code> grid is composed of <code>1 x 1</code> squares where each <code>1 x 1</code> square consists of a <code>'/'</code>, <code>'\'</code>, or blank space <code>''</code>. These characters divide the square into contiguous regions.</p>
<p>Given the grid <code>grid</code> represented as a string array, return <em>the number of regions</em>.</p>
<p>Note that backslash characters are escaped, so a <code>'\'</code> is represented as <code>'\\'</code>.</p>