I have three lists I1, Indices and I2. I want to check elements in I1 and see how many elements in I2 are less than or equal to this element and modify the corresponding values in Indices and ultimately add 1 to the respective elements in I1.
For example,17 in I1 has two elements in I2 i.e. [8,11] which are less than 17.
19 in I1 has three elements in I2 i.e. [8,11,19] which are less than or equal to 19. So, the corresponding value in Indices need to be modified and 1 should be added to 19 in I1.
I present the expected output.
I1= [17, 19, 30, 31, 34, 46]
Indices = [[8, 11], [8, 11], [8, 11, 19], [8, 11, 19], [8, 11, 19], [8, 11, 19, 37, 40]]
I2 = [8, 11, 19, 37, 40, 42]
The expected output is
I1=[17, 19+1, 30, 31, 34, 46+1]
Indices = [[8, 11], [8, 11,19], [8, 11, 19], [8, 11, 19], [8, 11, 19], [8, 11, 19, 37, 40,42]]