JavaScript DFS beats 98.97%
\n\n\nvar findCircleNum = function(isConnected) {\n    let visited = new Set, provs = 0;\n    for(let i = 0; i < isConnected.length; i++) {\n        if(!(visite
\n\n```\nvar findCircleNum = function(isConnected) {\n    let visited = new Set, provs = 0;\n    for(let i = 0; i < isConnected.length; i++) {\n        if(!(visited.has(i))) {\n           provs++;\n           DFS(isConnected, i, visited);\n        }\n    }\n    return provs;\n};\n\nconst DFS = (isConnected, i, visited) => {\n    visited.add(i);\n    for(let j = 1; j < isConnected.length; j++) {\n        if(isConnected[i][j] && !(visited.has(j))) {\n            DFS(isConnected, j, visited);\n        }\n    }\n}\n```
['Depth-First Search', 'Recursion', 'Ordered Set', 'JavaScript']