Not Pro, Layman Solution
Intuition\nCounting of space makes me think of using dfs. Dfs makes me think of 1 and 0 connecting together. So change the question into 1 and 0 grid. I am not 
# Intuition\nCounting of space makes me think of using dfs. Dfs makes me think of 1 and 0 connecting together. So change the question into 1 and 0 grid. I am not pro, I made 2x2 grid at first but fail. So I try on 3x3. And it works.\n\n# Approach\n1.  Reform the Graph.\n2. Simple DFS.\n\nEnjoy coding. This is my first time posting solution. Thx!\n\n# Code\n```\nclass Solution {\n    public int regionsBySlashes(String[] grid) {\n        int width = grid.length * 3;\n        int[][] newGraph = new int[width][width];\n        for (int i = 0; i < grid.length; i++) {\n            for (int j = 0; j < grid[i].length(); j++) {\n                if (Character.toString(grid[i].charAt(j)).equals(" ")) {\n                    continue;\n                } else if (grid[i].charAt(j) == \'/\') {\n                    newGraph[i * 3][j * 3 + 2] = 1;\n                    newGraph[i * 3 + 1][j * 3 + 1] = 1;\n                    newGraph[i * 3 + 2][j * 3] = 1;\n                } else if (grid[i].charAt(j) == \'\\\\\') {\n                    newGraph[i * 3][j * 3] = 1;\n                    newGraph[i * 3 + 1][j * 3 + 1] = 1;\n                    newGraph[i * 3 + 2][j * 3 + 2] = 1;\n                }\n            }\n        }\n        int rows = newGraph.length;\n        int cols = newGraph[0].length;\n        boolean[][] visited = new boolean[rows][cols];\n        int componentCount = 0;\n        for (int i = 0; i < rows; i++) {\n            for (int j = 0; j < cols; j++) {\n                if (newGraph[i][j] == 0 && !visited[i][j]) {\n                    dfs(newGraph, visited, i, j, rows, cols);\n                    componentCount++;\n                }\n            }\n        }\n        return componentCount;\n\n    }\n\n    private static void dfs(int[][] grid, boolean[][] visited, int i, int j, int rows, int cols) {\n        if (i < 0 || j < 0 || i >= rows || j >= cols || visited[i][j] || grid[i][j] != 0) {\n            return;\n        }\n\n        visited[i][j] = true;\n\n        dfs(grid, visited, i - 1, j, rows, cols); // up\n        dfs(grid, visited, i + 1, j, rows, cols); // down\n        dfs(grid, visited, i, j - 1, rows, cols); // left\n        dfs(grid, visited, i, j + 1, rows, cols); // right\n    }\n}\n```
['Java']