← All problems
Longest Increasing Subsequence
Given an integer array, find the length of the longest strictly increasing subsequence. The subsequence need not be contiguous. Improve on the O(n^2) DP if you can.
Complexity
Time O(n log n), Space O(n)
Common pitfalls
- Claiming tails IS the LIS
- Non-strict comparison for strictly increasing
Your solution
Log in to save your code and track progress.