Skip to content

Instantly share code, notes, and snippets.

import timeit
# Starting from a particular crouton in the salad, traverse down to all other croutons
def myDFS(salad,crouton,length,paths,path=[]):
if crouton in path:
return
path=path+[crouton]
if len(path)==length:
paths.append(path)
else: