Given an array of n integers, find the length of its longest strictly increasing subsequence (LIS).
A subsequence does not have to be contiguous, but the original order of elements must be preserved.
The first line contains n.
The second line contains n integers.
Print one integer: the length of the longest increasing subsequence.
Write your solution, test it against custom input, then submit for a real verdict.
Your submissions, verdicts, drafts and contest score are tied to your account. Registration is free.
1 <= n <= 100000
Each value fits in a 32-bit signed integer.
8 10 9 2 5 3 7 101 18
4