Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Disposable Teleports by _Chico_
def checkio(teleports_string):
available_edges = set(teleports_string.split(','))
stack = [('1', available_edges)]
while stack:
my_route, available_edges = stack.pop()
if len(set(my_route)) == 8 and my_route.endswith('1'):
return my_route
next_stops = (c for c in available_edges if my_route[-1] in c)
for stop in next_stops:
stack.append((my_route + stop.strip(my_route[-1]),
available_edges-{stop}))
June 1, 2021