Skip to main content
1 of 4
Mr.Wizard
  • 272.3k
  • 34
  • 592
  • 1.4k
a = {1, 5, 10, 200, 50, 7};
b = {4, 3, 19, 78};

Mod[
  1 + Table[LengthWhile[b, # <= i &], {i, a}],
  Length@b + 1
]
 {1, 3, 3, 0, 4, 3}
Mr.Wizard
  • 272.3k
  • 34
  • 592
  • 1.4k