# longest_increasing_subsequence[prev] + array[i] if the length is longer.