UnifyApps interview question

Longest increasing subsequence question from the DP.