링크 : https://school.programmers.co.kr/learn/courses/30/lessons/43162
#include <string>
#include <vector>
using namespace std;
int check [201] = {};
void dfs(int current, int n, vector<vector<int>> computers){
check[current] = 1;
for(int i = 0; i < n; i++){
if(check[i] == 0 && computers[current][i] == 1){
dfs(i, n, computers);
}
}
}
int solution(int n, vector<vector<int>> computers) {
int answer = 0;
for(int i = 0; i < n; i++){
if(check[i] == 0){
dfs(i, n, computers);
answer ++;
}
}
return answer;
}