Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Tinus Trotyl's Pythonified solution in Clear category for How to Find Friends by veky
def check_connection(network, first, second):
subnet, todo = {first}, {frozenset(pair.split('-')) for pair in network}
while True:
for pair in todo:
if subnet & pair:
subnet |= pair
todo.remove(pair)
break
else: return second in subnet
July 12, 2017
Comments: