Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for How to Find Friends by MichalMarsalek
def check_connection(network, first, second):
if not network:
return False
if isinstance(network, tuple):
network = [con.split("-") for con in network]
for con in network:
if first in con and second in con:
return True
if first in con:
network.remove(con)
con.remove(first)
if check_connection(network, con[0], second):
return True
return False
Aug. 16, 2015