Pergunta de entrevista da empresa Amazon

Coding question 1: Least increasing subsequence