Amazon Interview Question

Longest increasing subsequence related question from DP