Amazon Interview Question

Coding question 1: Least increasing subsequence