Given an integer array nums, return the length of the longest strictly increasing subsequence.
Input: nums = [10,9,2,5,3,7,101,18]
Output: 4
Explanation: LIS is [2,3,7,101].
Topics: dp, binary-search
Asked by: Amazon, Google, Meta, Microsoft, Apple, Bloomberg
Time complexity: O(n log n). Space complexity: O(n).