Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
[4-liner] 170 chars solution in Creative category for On the same path by Phil15
def on_same_path(t,p):
def d(r,C):nonlocal T;T+=1;i[r]=T;[d(*c)for c in C];T+=1;o[r]=T
T,i,o=0,{},{};d(*t)
for u,v in p:yield i[u]
Dec. 8, 2019
Comments: