300. Longest Increasing Subsequence
Given an unsorted array of integers, find the length of longest increasing subsequence.
For example, Given [10, 9, 2, 5, 3, 7, 101, 18], The longest increasing subsequence is [2, 3, 7, 101], therefore the length is 4. Note that there may be more than one LIS combination, it is only necessary for you to return the length.
- 给出一个序列 $a_1, a_2, …, a_n$,求它的一个子序列(设为 $s_1, s_2, …, s_n$ ),使得这个子序列满足这样的性质:$ s_1 < s_2 < s_3 <…< s_n $ 并且这个子序列的长度最长,输出这个最长的长度。实际上,诸如最长下降子序列,最长不上升子序列等问题都可以看成同一个问题,仔细思考就会发现,这其实只是 $<$ 符号定义上的问题,并不影响问题的实质。