Given an integer array nums, return the length of the longest strictly increasing subsequence.
An increasing subsequence is any sequence you can form by deleting zero or more elements without changing the order of the remaining values.
The chosen values do not need to be adjacent in the original array.
Examples
Input:[10,9,2,5,3,7,101,18]
Output:4
Input:[0,1,0,3,2,3]
Output:4
Hints
DP: dp[i] = LIS ending at index i.
For each i, check all j < i where nums[j] < nums[i].
Use binary search (patience sorting) for O(n log n).