Home>

Let's say I have lists: pum, root, number

pum= [9, 15, 4]
root= [3, 2]
number= [15]

And I need to end up with a list of all_numbers

all_numbers= [3, 15, 2]

I also want to note that 15 (or any other number) can be in different parts of the list

For example:

pum= [15, 9, 4]
root= [3, 2]
number= [15]

And in the end:

all_numbers= [15, 3, 2]

How the algorithm should work:

First, the numbers 3 and 2 are added to the list, after which, if 15 was in the middle of the Pum list, then it is added to the middle of the all_numbers list, if at the beginning, then at the beginning, etc.

Please correct the question to reflect the specific problem with enough detail to be able to provide an adequate answer.

Дух сообщества2021-11-22 17:15:11

how is all_numbers compiled?

Danis2021-11-21 17:24:45

First, the numbers 3 and 2 are added to the list, after which, if 15 was in the middle of the Pum list, then it is added to the middle of the all_numbers list, if at the beginning, then at the beginning, etc.

Дмитрий2021-11-21 18:43:44