Amazon interview question

longest increasing subsequence, water fill question