Answer by march for How do I recurrently process irregular lists until they...
Try this on a couple of use cases.A = {0, 1, 8, 10, 16, 17, 24, 32, 33, 34, 40, 48};B = {1, 2, 3, 9, 17, 18, 25, 27, 33, 34, 41};Module[{aA = Reverse@A, res}, Table[ If[bs >= aA[[-1]], {aA, res} =...
View ArticleHow do I recurrently process irregular lists until they are empty?
I want to solve the following task:I have two sorted lists A and B. Let's sayA={0, 1, 8, 10, 16, 17, 24, 32, 33, 34, 40, 48} andB={1, 2, 3, 9, 17, 18, 25, 27, 33, 34, 41}.From those two lists I want to...
View ArticleAnswer by E. Chan-López for How do I recurrently process irregular lists...
According to the given conditions, we can combine Do and While to get the pairs and at the end split the list of pairs according to the first element of each pair using SplitBy, and finally take the...
View ArticleAnswer by Karl for How do I recurrently process irregular lists until they...
Clear[f]A = {0, 1, 8, 10, 16, 17, 24, 32, 33, 34, 40, 48};B = {1, 2, 3, 9, 17, 18, 25, 27, 33, 34, 41};f[A_, B_] := Module[{ia = 1, ib = 1}, Reap[While[ib <= Length@B, If[A[[ia]] <= B[[ib]],...
View Article
More Pages to Explore .....