C++ Clean, easy to read code
```\nclass Solution {\n    \n    void dfs(int i, int j, vector>& matrix) {\n        if (i < 0 or i == matrix.size() or j < 0 or j == matrix[i].size() or matrix[
```\nclass Solution {\n    \n    void dfs(int i, int j, vector<vector<int>>& matrix) {\n        if (i < 0 or i == matrix.size() or j < 0 or j == matrix[i].size() or matrix[i][j] == 1)\n            return;\n        \n        matrix[i][j] = 1;\n        \n        dfs(i, j + 1, matrix);\n        dfs(i, j - 1, matrix);\n        dfs(i + 1, j, matrix);\n        dfs(i - 1, j, matrix);\n    }\n    \npublic:\n    int regionsBySlashes(vector<string>& grid) {\n\t\t// scale the grid into a 2D matrix\n        int n = grid.size() * 3;\n        vector<vector<int>> matrix(n, vector<int>(n));\n        \n        for (int i = 0; i < grid.size(); i++) {\n            for (int j = 0; j < grid[i].length(); j++) {\n                if (grid[i][j] == \' \')\n                    continue;\n                \n                int row = i * 3;\n                if (grid[i][j] == \'\\\\\') {\n                    int col = j * 3;\n                    \n                    for (int k = 0; k < 3; k++)\n                        matrix[row++][col++] = 1;\n                }\n                else {\n                    int col = j * 3 + 2;\n                    \n                    for (int k = 0; k < 3; k++)\n                        matrix[row++][col--] = 1;\n                }\n            }\n        }\n        \n\t\t//  from here, its the same as \'Number of Islands problem\'\n        int count = 0;\n        \n        for (int i = 0; i < matrix.size(); i++) {\n            for (int j = 0; j < matrix[i].size(); j++) {\n                if (matrix[i][j] == 0) {\n                    count++;\n                    dfs(i, j, matrix);\n                }\n            }\n        }\n        \n        return count;\n    }\n};
[]