Pergunta de entrevista da empresa Amazon

Longest increasing subsequence related question from DP