• + 1 comment

    Can be solved in O(n), but O(nlogn) works fine as in LIS.