simpest way to get the longest sequence of sorted elements from a given unsorted integer vector in c++

Viewed 2543

I have an unsorted array and need to extract the longest sequence of sorted elements. For instance

A = 2,4,1,7,4,5,0,8,65,4,2,34

here 0,8,65 is my target sequence

I need to keep track of the index where this sequence starts

3 Answers
Related