Domanda di colloquio di Amazon

Longest increasing subsequence related question from DP