Message from C, C++ talks

June 2019

— Numbering is broken by the way :)

— Hope you get the idea, but not sure if it works :)

— After removing the larger values , I will be left with another small array of levels of pesticides and this again needs to be sorted out by removing the rightside value if it's bigger

Message permanent page

— So doing it again will need an another loop

— 

My idea that in this loop you always keep the part on the left in the state when there are no ascending values. So after this loop you'll get the result as if you do all the loops.

The difference with the approach that is described in the task, that here you always look at the last valid value. Not on the value that was probably removed.

— Ok wait, i got what you said

— I will implement it tommorow morning.

— Thanks btw, nice approach

— NP, I still not completely sure if it works :D

— I think it will work

— Yes

— Oh, and also, I think the removement of elements can be eliminated here somehow. It can be faster without removement, also in real world situation you may want to keep the data immutable.

Message permanent page

— Also if I remove elements then step 1.2.3 messes up

— Not waiting for tommorow morning. I'm doing it now

— No, it shouldn't, because you don't need to save value of removed item (it doesn't matter what value the deleted item had)

Message permanent page