Pergunta de entrevista da empresa AccioJob

Next higher permutation. Longets common subsequence