Very easily explained || 100%✅✅|| TC and SC thoroughly explained
Intuition\nYou just need to breakdown this question into count number of island problem using graph\n\n# Approach\nThe Hint is - \nyou need to make a new 2d arr
# Intuition\nYou just need to breakdown this question into count number of island problem using graph\n\n# Approach\nThe Hint is - \nyou need to make a new 2d array for your island problem with dimenstion(n*3 X n*3)\nwherever you get \'\\\' you put [1,1,1] in that space in your new 2d array\nyou just need to think how to put 1 at the proper place\n\n# Complexity\n- Time complexity:\nO(n*3 * n*3 * 4) ~ O(n^2)\n\n- Space complexity:\nO(n*3 * n*3) + reccursion stack space of O(n*3 * n*3)\n\n# Code\n```\nclass Solution {\npublic:\n\n    void dfs(int row, int col, vector<vector<int>>&vec, vector<vector<int>>&vis, int del_row[], int del_col[], int n){\n        vis[row][col] = 1;\n        \n        for(int i = 0 ; i < 4; i++){\n            int nrow = row + del_row[i];\n            int ncol = col + del_col[i];\n            if(nrow >= 0 && nrow < n*3 && ncol >= 0 && ncol < n*3 && vec[nrow][ncol] == 0 && vis[nrow][ncol] == 0){\n                dfs(nrow, ncol, vec, vis, del_row, del_col, n);\n            }\n        }\n    }\n    int regionsBySlashes(vector<string>& grid) {\n        int n = grid.size();\n        vector<vector<int>>vec(n * 3, vector<int>(n * 3));\n        for(int i = 0 ;i < n ; i++){\n            for(int j = 0 ; j < n ; j++){\n                if(grid[i][j] == \'/\'){\n                    vec[i * 3][j * 3 + 2] = vec[i * 3 + 1][j * 3  + 1] = vec[i * 3 + 2][j * 3] = 1;\n                }\n                else if(grid[i][j] == \'\\\\\'){\n                    vec[i * 3][j * 3] = vec[i * 3 + 1][j * 3 + 1] = vec[i * 3 + 2][j * 3 + 2] = 1;\n                }\n            }\n        }\n\n\n        vector<vector<int>>vis(n * 3, vector<int>(n * 3, 0));\n\n        int count = 0;\n        int del_row[4] = {0, -1, 0, +1};\n        int del_col[4] = {-1, 0, +1, 0};\n        for(int i = 0; i < n*3; i++){\n            for(int j = 0; j < n*3 ; j++){\n                if(!vis[i][j] && vec[i][j] == 0){\n                    count = count + 1;\n                    dfs(i, j, vec, vis, del_row, del_col, n);\n                }\n            }\n        }\n        return count;\n    }\n};\n```
['C++']