[LeetCode] 300. Longest Increasing Subsequence 最长递增子序列
Given an unsorted array of integers, find the length of longest increasing subsequence. Example: Input: [10,9,2,5,3,7,101,18] Output: 4 Explanation: The longest increasing subsequence is [2,3,7,101] , therefore the length is 4 . Note: There may be more than one LIS combination, it is only necessary for you to return the length. Your algorithm should run in O( n2 ) complexity. Follow up: Could you improve it to O( n log n ) time complexity? 这道题让我们求最长递增子串 Longest Increasing Subsequence 的长度,简称 LIS 的长度。我最早接触到这道题是在 LintCode 上,可参见我之前的博客 Longest Increasing Subsequence ,那道题写的解法略微复杂,下面来看其他的一些解法