Domanda di colloquio di Google

Write a function to find the longest increasing subsequence in an integer array, optimizing for time complexity better than O(n^2).