Full explaination with testcases, Easy to Understand
Intuition\n Describe your first thoughts on how to solve this problem. \nBefore begining with this solution I would highly recommend you to go through this prob
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n*Before begining with this solution I would highly recommend you to go through this problem [Number of Islands](https://leetcode.com/problems/number-of-islands/solutions/3146758/92-85-faster-c-graph-dfs-explained)*\n\nTLDR, Generate 3x3 Binary matrix and apply Number of Islands Approach, But for why 3x3 read the whole intuition. \n\n\nAfter reading the problem statement it is clear that we have to count number of regions where we have empty area in the given figure. Now we can think of a dfs in a matrix to find the number of area kind of like [Number of Islands](https://leetcode.com/problems/number-of-islands/solutions/3146758/92-85-faster-c-graph-dfs-explained). But the problem here is the way input is provided using \\\\ and / which makes our job difficult.\n\nNow we can tackle this by making our own binary matrix and solv it using [Number of Islands](https://leetcode.com/problems/number-of-islands/solutions/3146758/92-85-faster-c-graph-dfs-explained) approach.\n\nNow the question is how do we convert it to binary matrix. Well you may thinkg of converting each \\ , / and \' \' to 1 and 0. But you will quickly realize this will not solve your problem take this testcase ```["/\\\\","\\\\/"]``` now the generated 1x1 binary matrix for this would be :\n\n>1 1\n>1 1\n\nBut how do we count the spaces if there are no zeros? So maybe 2x2 is the answer? Well, the answer is no. Check from this testcase ```["//","/ "]``` the binary 2x2 matrix would be\n\n> 0101\n1010\n0100\n1000\n\nWe can see there are three reigons but if you do 4 directional dfs on this matrix it wont take the diagonal in consideration and if you do 8 directional dfs to take diagonal in consideration you will take up \nanother diagonal too which will go through out boundary. Thats why these things are covered in 3x3 binary matrix and 4 directional dfs.\n\n\nAsk me in the comments if you have any doubt i will clarify your doubts and add them to this solution to make it more comprehensive.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n- Generate 3x3 binary Matrix\n- Do dfs and find the number of islands\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n    O(N*M);\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n    O(N*M)\n# Code\n```\nclass Solution {\npublic:\n    //3x3 blocks for each character \' \', \'/\' and \'\\\\\' respectively\n    vector<vector<int>> empty = {{0,0,0},{0,0,0},{0,0,0}};\n    vector<vector<int>> sb = {{0,0,1},{0,1,0},{1,0,0}};\n    vector<vector<int>> cb = {{1,0,0},{0,1,0},{0,0,1}};\n    //4 directions for dfs\n    vector<int> x = {1,0,-1,0};\n    vector<int> y = {0,1,0,-1};\n    //To Store our binary matrix\n    vector<vector<int>> mat;\n    //Normal DFS to find number of islands\n    void dfs(int i,int j){\n        if(i < 0 || i >= mat.size() || j < 0 || j >= mat[0].size() || mat[i][j] == 1) return;\n        mat[i][j] = 1;\n        for(int k=0;k<4;k++){\n            int newi = i+x[k];\n            int newj = j+y[k];\n            dfs(newi,newj);\n        }\n    }\n    // To fill the our binary matrix with the blocks we made\n    void filling(vector<vector<int>> &arr,int i){\n        for(int k=0;k<3;k++){\n            mat[i].push_back(arr[0][k]); \n            mat[i+1].push_back(arr[1][k]); \n            mat[i+2].push_back(arr[2][k]);\n        }\n    }\n    int regionsBySlashes(vector<string>& grid) {\n        mat.resize(grid.size()*3);\n        int ind=0;\n        //Fill with appropriate blocks \n        for(int i=0;i<grid.size();i++){\n            for(int j=0;j<grid[i].size();j++){\n                if(grid[i][j] == \' \') filling(empty,ind);\n                else if(grid[i][j] == \'/\') filling(sb,ind);\n                else filling(cb,ind);\n            }\n            ind+=3;\n        }\n        //Number of Islands\n        int ans =0;\n        for(int i=0;i<mat.size();i++){\n            for(int j=0;j<mat[0].size();j++){\n                if(mat[i][j] == 0){\n                    dfs(i,j);\n                    ans++;\n                }\n            }\n        }\n        return ans;\n    }\n};\n```
['Depth-First Search', 'C++']