C++(Using Disjoint Set)
Please Upvote if you like the Solution!\n\n    class Solution {\n    public:\n    vector rank;\n    vector parent;\n    int count;\n    int findparent(int node)
**Please Upvote if you like the Solution!**\n\n    class Solution {\n    public:\n    vector<int> rank;\n    vector<int> parent;\n    int count;\n    int findparent(int node)\n    {\n        if(node==parent[node])\n            return node;\n        return parent[node]=findparent(parent[node]);\n    }\n    void unionn(int u,int v)\n    {\n        u=findparent(u);\n        v=findparent(v);\n        if(u!=v)\n        {\n        if(rank[u]<rank[v])\n            parent[u]=v;\n        else if(rank[u]>rank[v])\n            parent[v]=u;\n        \n        else\n        {\n            parent[v]=u;\n            rank[u]++;\n        }\n        }\n        else\n        {\n            count++;\n        }\n            \n    }\n    int regionsBySlashes(vector<string>& grid) \n    {\n        int n=grid.size();\n        int dots=n+1;\n        \n        parent=vector<int>(dots*dots+1);//resize\n        rank=vector<int>(dots*dots+1);\n        count=1;\n        \n        for(int i=0;i<parent.size();i++)//Initialize Parent and rank\n        {\n            parent[i]=i;\n            rank[i]=1;\n        }\n        \n        for(int i=0;i<dots;i++)//for all boundary elements having parent 0\n        {\n            for(int j=0;j<dots;j++)\n            {\n                if(i==0 or j==0 or i==dots-1 or j==dots-1)\n                {\n                    int cellno=i*dots+j;\n                    if(cellno!=0)\n                    unionn(0,cellno);\n                }\n            }\n        }\n            for(int i=0;i<n;i++)\n            {\n                for(int j=0;j<n;j++)\n                {\n                    if(grid[i][j]==\'/\')\n                    {\n                        int cellno1=i*dots+(j+1);\n                        int cellno2=(i+1)*dots+j;\n                        unionn(cellno1,cellno2);\n                    }\n                    else if(grid[i][j]==\'\\\\\')\n                    {\n                        int cellno1=i*dots+j;\n                        int cellno2=(i+1)*dots+(j+1);\n                        \n                        unionn(cellno1,cellno2);\n                    }\n                        \n                }\n            }\n        return count;\n    }\n    };
['Union Find', 'Graph', 'C', 'C++']