Progress interview question

Longest possible sequence in the given array