Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
StopIteration solution in Clear category for Disposable Teleports by gyahun_dash
def checkio(string, length=8, start='1'):
def explore(edges, route):
node = route[-1]
if node == start and len(set(route)) == length:
raise StopIteration(route)
for edge in (edge for edge in edges if node in edge):
explore(edges - {edge}, route + edge.replace(node, ''))
try: explore(set(string.split(',')), start)
except StopIteration as found: return found.value
Oct. 18, 2014
Comments: