Amazon Interview Question

The task was to find the longest increasing subsequence.