C++ 100% Beats.
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\nvoid dfs(int s, int n, vector<vector<int>>& isConnected, vector<bool>&visited){\n        visited[s] = true;\n        \n        \n        vector<int>adj;\n        for(int i=0; i<n; i++ ){\n            int x =  isConnected[s][i];  // x = connection\n            if(x == 1)\n                adj.push_back(i);\n        }\n        \n        for(auto x: adj){\n            if(!visited[x]){\n                dfs(x, n, isConnected, visited);\n            }\n        }\n        \n      } \n    int findCircleNum(vector<vector<int>>& isConnected) {\n       int n=isConnected.size();\n         vector<bool> visited(n,0);\n         int ans=0;\n\n         for(int i=0;i<isConnected.size();i++){\n             if(!visited[i]){\n                 ans++;\n                 dfs(i,n,isConnected,visited);\n             }\n         }\n       \n        return ans;  \n    }\n};\n```
['C++']