From ceee2fbc4b02ea30c5c870d7874af4031fa9e10f Mon Sep 17 00:00:00 2001 From: yongjun-0903 <472dyd@gmail.com> Date: Wed, 26 Mar 2025 23:04:31 +0900 Subject: [PATCH] =?UTF-8?q?=EF=BF=BD=20Study:=20=EB=84=A4=ED=8A=B8?= =?UTF-8?q?=EC=9B=8C=ED=81=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\204\244\355\212\270\354\233\214\355\201\254.py" | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 "yongjun-0903/\353\204\244\355\212\270\354\233\214\355\201\254.py" 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)