I have a list of numbers like
l1 = (1,2,3,4,8) and clearly, l1 is in order (next number is greater than previous number).
Well, I have a list of l2 = {1,2,4,3,8}. Because 3 is not in order, I want to drop 3 so that I have a new list of l2new = {1,2,4,8} which is now in order.
What is the algorithm to have l2new from l2?
To clarify my purpose, I introduce another example:
If I have l3 = {1,2,8,4,5}, then I want to have l3new = {1,2,8}.




DeleteDuplicates[{1,2,5,3,4,6}, GreaterEqual]is given (in a comment) by @Roman – user1066 Jun 28 '23 at 09:47