Amazon Interview Question

A question on Dynamic Programming.....a modification of longest increasing subsequence problem