Compute length of longest increasing subsequence | TikTok Interview Question