Amazon interview question

longest increasing subsequence