fork download
  1. def f(N,L,i=0):
  2. if`N`<":":return L[i],i+1
  3. X=[]
  4. for n in N:M,i=f(n,L,i);X+=[M]
  5. return X,i
  6. g=lambda N,L:f(N,L)[0]
  7.  
  8. print(g([0,[1,[]],[[]],[2,3],[]], [1,6,1,8]))
Success #stdin #stdout 0.01s 7896KB
stdin
Standard input is empty
stdout
[1, [6, []], [[]], [1, 8], []]