Pregunta de entrevista de Amazon

Coding question 1: Least increasing subsequence