- Using the the Longest Common Subsequence algorithm on a sequence with its sorted self:
`O(n^2)`

- Using a dynamic programming algorithm described here . It is also
`O(n^2)`

, but faster than (1) because of better constants and less generality. - Using a greedy algorithm described here, that runs in
`O(n*log(n))`

# Longest Increasing Subsequence

For comments, please send me an email, or reach out on on Twitter.