Pergunta de entrevista da empresa Meta

Longest Increasing Subsequence, with different constraints