• when program return False ,the check say False


I would like to give some feedback about ...

From: http://www.checkio.org/mission/find-friends/solve/


Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36 AppEngine-Google; (+http://code.google.com/appengine; appid: s~water789520)

s=set() l=[] offset=1

def search(): global s global l global offset offset=0 s2=s.copy() for ss in s: for ll in l: if ss in ll : if not(ll[0] in s and ll[1] in s): offset=1 s2.update(ll) return s2


def check_connection(network, first, second): global l global s global offset s.add(first,) for cell in network: l.append(cell.split('-'))


print s
return first in s and second in s

if name == 'main': print check_connection(("dr101-mr99","mr99-out00","dr101-out00","scout1-scout2","scout3-scout1","scout1-scout4","scout4-sscout","sscout-super",),"dr101","sscout")