Skip to content

Commit

Permalink
23-2
Browse files Browse the repository at this point in the history
  • Loading branch information
koosvary committed Dec 23, 2024
1 parent 06426ca commit 99e8d2d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions 2024/23/23-2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import networkx as nx

with open('2024/23/input.txt') as f:
graph = nx.Graph()

for line in f:
line = line.strip()
connections = line.split('-')
graph.add_edge(connections[0], connections[1])

cliques = list(nx.find_cliques(graph))
biggestClique = sorted(max(cliques, key=len))

print(','.join(biggestClique))

0 comments on commit 99e8d2d

Please sign in to comment.