Problem
Given an unsorted array of integers, find the length of longest increasing subsequence.
Example
1 | Input: [10,9,2,5,3,7,101,18] |
Solution1
Method: Dynamic Programming
Time Complexity: O(n^2)
Space Complexity:
1 | class Solution: |
Other Solution
Key Point
Add an infinite value at the head.