← 返回 linkedin 的题目列表Longest Increasing Subsequence
类型:online_judge
Given an unsorted integer array, find the length of the longest increasing subsequence.
Input Format:
An integer array nums, with length range of [1, 2500] and each element in the range of [-10^4, 10^4].
Output Format:
Output the length of the longest increasing subsequence.
Example:
Input: [10,9,2,5,3,7,101,18]
Output: 4
Constraints:
Try to design an algorithm with time complexity O(n^2) or O(n log n).
Example
Input
10
9
2
5
3
7
101
18