How to find the longest increasing subsequence in LeetCode problem 300?