Skip to content

Commit ddfe2d3

Browse files
authored
� Study: 네트워크 (#54)
1 parent dddbd8d commit ddfe2d3

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

yongjun-0903/네트워크.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
def solution(n, computers):
2+
network = 0
3+
graph = {}
4+
for i in range(n):
5+
if i not in graph:
6+
graph[i] = []
7+
for j in range(n):
8+
if i != j and computers[i][j] == 1:
9+
graph[i].append(j)
10+
print(graph)
11+
12+
visited = [False for _ in range(n)]
13+
print(visited)

0 commit comments

Comments
 (0)