← 返回 bytedance 的题目列表Finding the Longest Increasing Subsequence
类型:online_judge
Given an unsorted array of integers, find the length of the longest strictly increasing subsequence.
Requirements:
The time complexity should be O(n log n).
Input Format:
A line of spaced integers representing the elements of the array.
Output Format:
An integer representing the length of the longest increasing subsequence.
Sample Input:
10 9 2 5 3 7 101 18
Sample Output:
4
Constraints:
The length of the array is within [1, 2500], and each integer in the array is between [-10^4, 10^4].
Example
Input
10 9 2 5 3 7 101 18