diff --git "a/yongjun-0903/\353\204\244\355\212\270\354\233\214\355\201\254.py" "b/yongjun-0903/\353\204\244\355\212\270\354\233\214\355\201\254.py" new file mode 100644 index 0000000..0d3d976 --- /dev/null +++ "b/yongjun-0903/\353\204\244\355\212\270\354\233\214\355\201\254.py" @@ -0,0 +1,13 @@ +def solution(n, computers): + network = 0 + graph = {} + for i in range(n): + if i not in graph: + graph[i] = [] + for j in range(n): + if i != j and computers[i][j] == 1: + graph[i].append(j) + print(graph) + + visited = [False for _ in range(n)] + print(visited)