Skip to main content
Source Link
ciao
  • 26k
  • 2
  • 61
  • 142

step1 = ReplaceList[list1, {a__, b_, ___} :> b/{a}]
step2 = FlattenAt[(Flatten /@ Thread[{list2[[;; Length@#1]], #1}]) & /@step1, 1]
Post Made Community Wiki by ciao