[The python solution here](https://github.com/neetcode-gh/leetcode/blob/main/python/300-Longest-Increasing-Subsequence.py) is O(n^2) but can be made O(n log(n)) by replacing the linear search in the inner loop with a binary search. Check out [this solution in the discussion](https://leetcode.com/problems/longest-increasing-subsequence/discuss/74824/JavaPython-Binary-search-O(nlogn)-time-with-explanation).