Amity
Networks — Tag Graph Components
“Follow the lines, find the schools.” — Harbor Analytics
Challenge:
Build an undirected graph from tag pairs and count connected components.
Telemetry • Graph Theory
Task:
Implement
count_components(pairs)
.
pairs
is a list of edges like
[(1,2),(2,3),(4,5)]
. Count the number of connected groups.
Click
Run Unit Tests
. If all tests pass, you'll get the flag.
def count_components(pairs): # Your code here return 0 # Test runner do not edit below run_selected_test()
Run Unit Tests
Output or flag will appear here...