Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Simple solution in Clear category for Digits Doublets by Pouf
def checkio(numbers):
paths = [[numbers[0]]]
while True:
p = paths.pop(0)
for c in set(numbers)-set(p):
if sum(x!=y for x, y in zip(str(p[-1]), str(c))) == 1:
if c == numbers[-1]:
return p + [c]
paths.append(p + [c])
Oct. 4, 2015
Comments: