Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
4 lines solution in Creative category for How to Find Friends by DiZ
def check_connection(edges, source, destination):
graph, edges = {source}, [set(e.split('-')) for e in edges]
for _ in edges: graph.update(*filter(graph.intersection, edges))
return destination in graph
Sept. 3, 2015
Comments: