Skip to main content
1 of 1
ciao
  • 26k
  • 2
  • 61
  • 142
step1 = ReplaceList[list1, {a__, b_, ___} :> b/{a}]
step2 = FlattenAt[(Flatten /@ Thread[{list2[[;; Length@#1]], #1}]) & /@step1, 1]
ciao
  • 26k
  • 2
  • 61
  • 142